Skip Navigation

[Closed] Using a WYSIWYG field inside an WPV-IF statement

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 10:00 – 19:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

This topic contains 6 replies, has 2 voices.

Last updated by Caridad 9 years, 1 month ago.

Assisted by: Caridad.

Author
Posts
#284221

Hi all

I have a custom type for sporting CLUBS.

The clubs have a HISTORY field which is a WYSIWYG field.

If I just link to the shortcode like this: [types field="history"]

Then, the output shows the text including paragraphs.

But, if I do this (to check it the field is empty):

[wpv-if test="wpcf-history" evaluate="!empty($test)"][types field="history"][/types][/wpv-if]

Then it strips out the paragraphs and shows it as one long paragraph

To me, this seems like a bug - as the code to show the actual field is identical.

I don't want to turn on the "auto paragraphs" feature as that affects the spacing between fields that I Don't want.

#284222

Ok, so it's not so much that it's wrapped in the IF statement, it's just because it's the second time.

If I do this:

[types field="history"][/types]
[types field="history"][/types]

The FIRST one outputs RAW without paragraph tags

The SECOND one outputs HTML with the paragraph tags

How is that even logical

#284224

If I do this:

[types field="history"][/types]
[types field="history"][/types]
[types field="history"][/types]
[types field="history"][/types]
[types field="history"][/types]

Then the first one has no paragraphs, and the next 4 do.

#284475

I have been trying to reproduce your problem with different content in the WYSIWYG field and I do see a problem there with the paragraphs, but Im not sure if its the same thing you are seeing.

Can you share access to the page with your problem so I can be more specific in my report to the developers?

Thanks
Caridad

#284786

Any ideas?

#285775

I reported the issue to our developers, I will get back to you as soon as I have some feedback.

Regards
Caridad

#286837

Our developers have been looking into this, and the issue seems to be the opposite. Its the result of apply the_content filter for both the WYSIWYG fields and for the post body.

The Content Template being used has the formatting options set to “Manual paragraphs??, which means that there should be no paragraph being added to the content.

The way it works, first resolve the types shortcodes in the Content Template, and then apply that Content Template to the post itself. In this case, we resolve the first Types shortcode following the rule to not add paragraphs. As this is a WYSIWYG field, it is getting applied a the_content filter, which invalidates the Content Template rule to not add paragraphs. It results on the second Types shortcode having paragraphs.

So, as you see, the first Types shortcode is behaving correctly, and it is the second one (displaying paragraphs) the strange one.

Can you make them both display paragraphs? Sure: use [types field=??history?? suppress_filters=??true??][/types] in both Types shortcodes and you should be good to go.

Let me know if this works for you.
Regards
Caridad

The topic ‘[Closed] Using a WYSIWYG field inside an WPV-IF statement’ is closed to new replies.