Skip Navigation

[Resolved] Add line break to the description of publication fields

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 7 replies, has 3 voices.

Last updated by Nigel 5 months ago.

Assisted by: Nigel.

Author
Posts
#2711663
Capture d’écran 2024-08-06 à 17.23.36.png

Hello,
Is it possible in the Description field (<textarea id="wpcf-group-description" name="wpcf[group][description]" </textarea>) to manage line breaks?

In fact, I use the description field of the publication fields to show some shortcodes as examples to my client when he fills in the site.
I'd like this field to be able to be formatted to avoid separations via "*" with line breaks.

Quentin

#2711789

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - with plain text I can see when you add Enter and add few lines and again add Enter it does keep the line breaks as it is with the custom field group description box. Please check the following screenshot: hidden link

When if you hit enter and add the line brakes - it does not help?

#2711800
Capture d’écran 2024-08-07 à 12.20.12.png
Capture d’écran 2024-08-07 à 12.20.01.png

Unfortunately it doesn't seem to work for me... see attached

#2715812

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I can see the issue and I've escalated the issue in front of our next level support.

Please hold on for further updates.

#2722760

Hello Minesh,

Okay, got it.
I'll wait for the next Toolset update.

Will HTML be fully interpreted? Will it be possible to make <br /> and bold words ?

Quentin

#2723219

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Quentin

Minesh is on vacation, so let me take over here.

When he said "hold on for further updates" I think he meant further updates in this thread, not plugin updates.

I can't say whether the developers will have a permanent solution for this or not.

However, I can see from the work in progress in the internal ticket that a simple workaround is available in the meantime.

You can edit the file wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields-post.php and comment out line 527, i.e. add // at the start of it, like so

			// $description = ( null !== $group_wpml ? $group_wpml->translate_description() : $description );

That will prevent any HTML tags being stripped from your description, so you can use simple markup like <p> and <br> tags.

I'll update you again when there is more news in the ticket.

#2723222

Hello Nigel,

Thanks for a solution that works!
If a new update is available from Toolset, I imagine it will overwrite my comment in fields-post.php?

Quentin

#2731882

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hello again Quentin

I had a discussion with the developers.

They said that the description field was envisaged as a simple text description field, not a WYSIWYG-type field, and so was implemented that way, and this is the first time it has been brought up in a decade.

It wouldn't be too difficult to change, but it is part of integration code with WPML, and changing it could have unforeseen implications for multilingual sites, and existing clients losing translations.

So, they said they won't change this, unless we get a lot of requests from other users, in which case they will reconsider it.

So you will need to decide. If you want to continue to be able to use formatted text for the description, you will need to make the same edit to the Types file whenever there is a Types update. (There are usually only a couple of those a year, though.)

Sorry I don't have better news.

#2731893

Hello Nigel,

Thanks for your feedback. I'll make a note of it.

Best regards,
Quentin