Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiline text #3

Open
joshangell opened this issue May 29, 2015 · 10 comments
Open

Add support for multiline text #3

joshangell opened this issue May 29, 2015 · 10 comments
Assignees

Comments

@joshangell
Copy link

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

@joshangell joshangell changed the title Add support for multiline cell types Add support for multiline text May 29, 2015
@joshangell joshangell self-assigned this Jul 23, 2015
@bilke
Copy link

bilke commented Aug 13, 2015

👍

@terryupton
Copy link

terryupton commented Sep 1, 2016

+1 for this. Any news on this feature?

@jonnylevy
Copy link

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?

@kristianserrano
Copy link

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

@jordanlev
Copy link

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: jordanlev@afa662b

@amici-infotech
Copy link

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

@jamesmacwhite
Copy link

I currently have hacked in multiline support from the changes made by jordanlev@afa662b 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.

@andrewfairlie
Copy link

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

@belkin
Copy link

belkin commented Jun 7, 2023

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>

@jamesmacwhite
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests