tablemaker icon indicating copy to clipboard operation
tablemaker copied to clipboard

Add support for multiline text

Open joshangell opened this issue 10 years ago • 10 comments
trafficstars

For example I think we want to be able to return in normal text cells

joshangell avatar May 29 '15 10:05 joshangell

:+1:

bilke avatar Aug 13 '15 18:08 bilke

+1 for this. Any news on this feature?

terryupton avatar Sep 01 '16 15:09 terryupton

We are using this plugin on a client's site and have just realised this shortfall. Would be great to have this implemented. Any update on this?

jonnylevy avatar Mar 09 '17 18:03 jonnylevy

Also, the ability to have rich formatted text so that we could bold, italicize or even link to other entries.

kristianserrano avatar Mar 09 '17 18:03 kristianserrano

If you're okay with ALL of your table cells being multiline (so you don't need per-field settings or per-column settings), then this is very easy to do. Just change the word 'singleline' to 'multiline' in a few places in the plugin code. See diff here: https://github.com/jordanlev/tablemaker/commit/afa662b02c075e23a2498167027b7553fd9d61e2

jordanlev avatar Apr 19 '17 21:04 jordanlev

+1 for multi line and rich text editor. My client wants to add paragraphs with bullets and bold - italic styles.

amici-infotech avatar Oct 13 '22 13:10 amici-infotech

I currently have hacked in multiline support from the changes made by https://github.com/jordanlev/tablemaker/commit/afa662b02c075e23a2498167027b7553fd9d61e2 in an older PR via a fork of the original tablemaker plugin. It would be good to support multiline in a more robust way though.

jamesmacwhite avatar Nov 10 '22 15:11 jamesmacwhite

Yeah multiline would enable rich text by allowing editors to write markdown which would improve the functionality here a lot.

andrewfairlie avatar Feb 07 '23 10:02 andrewfairlie

You can achieve multi-line/rich text effect by using |markdown or |md filter for markdown formatting. It's not great for the client but for simple things I think it's worth giving it shot.

I'm setting following row instruction:

For text formatting, [markdown](https://www.markdownguide.org/basic-syntax/) is available:

- Bold - `**text here**`
- Italic - `*text here*`
- Link - `[text here](https://www.markdownguide.org/basic-syntax/)`
- New line - `<br>`

<br> isn't really markdown but it's supported in Craft while we can't use return to achieve real markdown new line with \.

image

Example code from readme with markdown filter:

<table>
    <thead>
        <tr>
            {% for col in entry.myTableField.columns %}
                <th align="{{ col.align }}" width="{{ col.width }}">{{ col.heading }}</th>
            {% endfor %}
        </tr>
    </thead>

    <tbody>
        {% for row in entry.myTableField.rows %}
            <tr>
                {% for cell in row %}
                    <td align="{{ entry.myTableField.columns[loop.index0].align }}">{{ cell|markdown }}</td>
                {% endfor %}
            </tr>
        {% endfor %}
    </tbody>
</table>

belkin avatar Jun 07 '23 09:06 belkin

@belkin Interesting approach, the issue is markdown isn't really editor friendly and more likely to be something developers know and use. You can hack in multiline support. I have done this with the Craft CMS 2 and 3 version, you can also do it with the Craft 4 version, but it probably needs to be done properly via the fieldtype itself.

jamesmacwhite avatar Jun 07 '23 10:06 jamesmacwhite