tablemaker
tablemaker copied to clipboard
Add support for multiline text
For example I think we want to be able to return in normal text cells
:+1:
+1 for this. Any news on this feature?
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?
Also, the ability to have rich formatted text so that we could bold, italicize or even link to other entries.
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
+1 for multi line and rich text editor. My client wants to add paragraphs with bullets and bold - italic styles.
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.
Yeah multiline would enable rich text by allowing editors to write markdown which would improve the functionality here a lot.
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 \.
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 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.