Skip Navigation

[Resolved] Custom fields WYSIWYG problem

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 thread is resolved. Here is a description of the problem and solution.

Problem:
Content of WYSIWYG is overwritten by the_content() output.

Solution:
In certain circumstances, plugins using the_content() filter can add duplicated content to the WYSIWYG content – removing the filters can resolve this problem.

suppress_filters='true'

and all third party (non WordPress) filters hooked into the_content() filter will be removed, when retrieving the WYSIWYG content.

You can also use the suppress_filters in the views shortcode like the following:

[types field="custom-field"  suppress_filters ="true"][/types]

Example:
To add the argument "suppress_filters" and set it to "true", you just add the argument and it's value
(true or false) in the array's parenthesis, like this:

<?php echo types_render_field("contact2", array( "suppress_filters" => true )); ?>

Relevant Documentation:
- https://toolset.com/documentation/functions/#wysiwyg > attributes: suppress_filters.
- https://toolset.com/documentation/views-shortcodes/

This support ticket is created 8 years, 11 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 9 replies, has 2 voices.

Last updated by abdeljabarg 8 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#304023

I am trying to: Display Custom fields WYSIWYG that I already set, and I put shurtcode on the editor so it can be respolved when I display it

I visited this URL: you can visit the the following link and you can click on the envelop icon on the left sidebar to see the result I get.

I expected to see: the resloved result whitch is a contact form

Instead, I got: I got what the wp function the_content() displays, witch is the content of the page, and thats not what I want.

----------------

I will explain in different words :

My problem exactly is when I set custom field type as WYSIWYG editor, and when I try to display the contents this field I have other things displayed and I think what it is displaying is the what the wordpress function the_content() render and I am sending the attached image of what is displaying.

#304224

Thank you for contacting us here in the Support Forum

I will take care of your ticket.
Could you please share your Debug Informations with me?
https://toolset.com/faq/provide-debug-information-faster-support/

I don't see the image you probably wanted to attach, and I also have no URL where to look at, to see the issue.

Could you provide me this informations in your next reply, so I can help you more effectively?

You an read more about WYSIWYG here:
https://toolset.com/documentation/functions/#wysiwyg
https://toolset.com/documentation/user-guides/displaying-wordpress-custom-fields/
https://toolset.com/documentation/user-guides/using-custom-fields/

Please could you provide me the additional Infos?

Thank you

#304233

Okay thank you for your response.

First this is the url where I have used the plug-in : hidden link

I used the plugin to add custom types for the icons in left sidebar to display some fields.
If you click on the envelope icon, you will see a pop up window where there is some contents and for my little experience I think that what the wordpress function the_content() displays normally and it is not what I sat the plug-in to display, I sat a WYSIWYG field and I added a shurtcode of form to be displayed.

and this is the code I am using to display it : <?php echo types_render_field("contact2"); ?>

So if you get to the url It wouldn't be necessary to send an screenshot.

And you may need login and password to the wp admin, let me know if you do need this information please.

Thanks

Gouchti

#304533

Thanks for the Details

I see you display content with PopUps, and this you probably have done either with custom code or 3rd Party Plugins/Theme
Types has no default feature for PopUp displaying forms.

I checked this contents and I am not sure if this content is incorrect, because it displays on each PopUp different content, and it is, as far I can see not your

the_content

As you can see here,

the_content

is displaying either the entire content or up to the

<--!more-->

tag (if is used in post body contents).
https://codex.wordpress.org/Function_Reference/the_content

Your PopUps are all displaying distinct content, and I can not tell which of that content you also have in your Post / Page, since nothing is rendered as Body Content unless the Title

Have you included the Map you're seeing right now when clicking on the Envelope in the content of your post or into the Custom Field WYSIWYG?

Could you share the content of your:
a) Post/Page Body
b) WYSIWYG field
c) The workflow you're using to achieve this what you see right now here:
hidden link

Please could you provide me the additional Infos?

Thank you

#304557

Okay I understand you very well. And I will provide exact explanation this time and also I will provide you with access so you can see with yourself what i am trying to explain.

<access details removed by forum moderator>

1)
This is the event post I am adding fields to it : "Asamblea Anual 2016" : hidden link

You will notice that I am using two custom fields : Video field and WYSIWYG field.
The video field works perfect, if you click on the video icon you will see that it displays a video, I still didn't do any Css customization but I just need the functionality to work first.

But the Wisywyg don't, it displays what you see on the pop up whitch is not what I am asking for.(this is my problem!)

2) I was gonna put the php file I am using to put the code to display the fields as an attachment but I am allowed to attache just images so at the end of this message I'll compy and paste the portion where my coding is.
In line 22 is where I am adding the code for the wisywyg to display its contents.

3) I may wrong when saying that the popup displays the_content(), but maybe you will understand why I suppose that when you see the event page from the backend, you will see that what is displaying is what is already can be configured in that page.

I really appreciate your help here and I hope we figure out the problem.

Thanks a lot

Gouchti

single-event.php :

<ul class="action-buttons">
									<li class="hidden-xs" title="Get directions">
										<a class="cover-overlay-trigger" data-toggle="modal" href="#direction-popup" title="" data-rel="tooltip" rel="tooltip">
										<i class="fa fa-compass"></i>
										</a>
									</li>
									
									<div aria-hidden="true" role="dialog" tabindex="-1" class="modal hide fade" id="direction-popup">
									<div class="map-box">

									<div id="map_contact_1" class="map_canvas-2 active"></div>

								  </div>
									</div>
									
									<li title="Contact event manager">
										<a class="event-contact-link" data-toggle="modal" href="#form-contact-popup" title="" data-rel="tooltip" rel="tooltip">
										<i class="fa fa-envelope"></i>
										</a>
									</li>
									
									<div aria-hidden="true" role="dialog" tabindex="-1" class="modal hide fade" id="form-contact-popup">
									<h1><?php echo the_field('field_1'); ?></h1>
									</div>
									
									<li title="Print">
										<a href="javascript:window.print()">
										<i class="fa fa-print"></i>
									</a>
								</li>
								
								
								<li title="vidéo">
										<a data-toggle="modal" href="#video-popup" title="" data-rel="tooltip" rel="tooltip">
										<i class="fa fa-play-circle"></i>
									</a>
								</li>
								<div aria-hidden="true" role="dialog" tabindex="-1" class="modal hide fade" id="video-popup">
									<h1>text text text</h1>
									</div>
								
								<li title="gallery">
										<a data-toggle="modal" href="#gallery-popup" title="" data-rel="tooltip" rel="tooltip">
										<i class="fa fa-picture-o"></i>
									</a>
								</li>
								
								<div aria-hidden="true" role="dialog" tabindex="-1" class="modal hide fade" id="gallery-popup">
									<h1>gallery content</h1>
									</div>
                            </ul>

#304618

Thanks for the Details

Please acknowledge that I deleted your Access Details, they where Public.

I suggest you delete the User you set up for this porpoise.

I notice, you are not including the Types field as suggested here:
https://toolset.com/documentation/user-guides/displaying-wordpress-custom-fields/#1

echo types_render_field("custom-field-slug-name", array("argument1"=>"value1","argument2"=>"value2","argument2"=>"value2"));

You seem to include like this:

<?php echo the_field('field_1'); ?>

Try to change it to

<?php echo types_render_field("contact2", array( )); ?>

Please don't hesitate to inform me in case the issue persists and let me know if the above solution works for you, I look forward to your reply!

Thank you

#304620

Sorry I thought that this is private ticket. I deleted the account.

And sorry also because I sent a different code of an other plugin I used before, and this is the code I am using now, and it is exactly what you are asking me to do :

<li title="Contact event manager">
										<a class="event-contact-link" data-toggle="modal" href="#form-contact-popup" title="" data-rel="tooltip" rel="tooltip">
										<i class="fa fa-envelope"></i>
										</a>
									</li>
									
									<div aria-hidden="true" role="dialog" tabindex="-1" class="modal hide fade" id="form-contact-popup">
									<?php echo types_render_field("contact2", array( )); ?>
									</div>
									
									<li title="Print">
										<a href="javascript:window.print()">
										<i class="fa fa-print"></i>
									</a>
								</li>
								
								
								<li title="vidéo">
										<a data-toggle="modal" href="#video-popup" title="" data-rel="tooltip" rel="tooltip">
										<i class="fa fa-play-circle"></i>
									</a>
								</li>
								<div aria-hidden="true" role="dialog" tabindex="-1" class="modal hide fade" id="video-popup">
									<?php echo types_render_field("video"); ?>
									</div>
								
								<li title="gallery">
										<a data-toggle="modal" href="#gallery-popup" title="" data-rel="tooltip" rel="tooltip">
										<i class="fa fa-picture-o"></i>
									</a>
								</li>
								
								<div aria-hidden="true" role="dialog" tabindex="-1" class="modal hide fade" id="gallery-popup">
									<h1>gallery content</h1>
									</div>
                            </ul>

Thank you again for your support

Gouchti

#304857

Thanks for the Details

In certain circumstances, plugins using the_content filter can add duplicated content to the WYSIWYG content – removing the filters can resolve this problem.

You can use

suppress_filters='true'

, and all third party (non WordPress) filters hooked into the_content filter will be removed, when retrieving the WYSIWYG content.

You can read more about here:
https://toolset.com/documentation/functions/#wysiwyg > attributes: suppress_filters.

Please don't hesitate to inform me in case the issue persists

For this case I am re-enabling a Private Form, for you to provide the access details in a secure way.

Thank you

#305219
Bildschirmfoto 2015-05-21 um 10.39.30.png

Thanks for the Details

May I ask you to update all pending Plugins?
Specially our Types Plugin.

It was indeed the "suppress_filters" that needed to be set to "true".

I want to explain how you can do this, for future issues and to explain how to this in php:

1. Locate the related line of code, where you add the Types Custom Field
2. You currently used:

<?php echo types_render_field("contact2", array( )); ?>

(empty array, see array())
3. To add the argument "suppress_filters" and set it to "true", you just add the argument and it's value
(true or false) in the array's parenthesis, like this:

<?php echo types_render_field("contact2", array( "suppress_filters" => true )); ?>

This is also explained with a example here:
https://toolset.com/documentation/customizing-sites-using-php/functions/#wysiwyg > More
(Repeater attributes, User attributes, Usage examples)
Look at the example under
How to use this field with > user meta php.

It is a different argument, but it is always the same "mockup"

I did this changes already on your site, you won't need to do it anymore for this Field.
Please also see the screenshot.

Please let me know if you have further questions regarding the issue mentioned in this Thread
and let me know if the above solution works for you, I look forward to your reply!

Thank you

#305469

I thank you very very much Mr Beda, you've been very supportive, and actually I've tried to resolve this problem with the developer of the theme and he didn't help and also three other custom fields plug-in developers I had the same issue and they didn't help also.

So it was really a big help from you and I thank you very much.

Is there any where where I can leave a comment, a feedback or rating for your solution let me know please.

Thanks

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.