Skip Navigation

[Resolved] The WYSWYG Editor not escaping single and/or double quotes

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 13 replies, has 2 voices.

Last updated by webadmins 5 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1264447

I am trying to: Use both single and double quotes in the WYSIWYG editor however based on the current setup, this line of code in the toolset view doesn't allow double quotes in the WYSIWYG editor.

boxxy-blurb="[types field='boxxy-blurb' output='raw'][/types]" // Does no work
boxxy-blurb="[types field='boxxy-blurb'][/types]" // Does no work

Is there a way to assign boxxy-blurb the value of WYSIWYG editor without double quotes in the editor causing issues? Is there something like the code below that can be used...

boxxy-blurb=html_entities([types field='boxxy-blurb' output='raw'][/types])

Link to a page where the issue can be seen: hidden link (Blurb under the Update Your Organic Shopping List! image)

I expected to see: Both single quotes and double quotes rendered on page

Instead, I got: Nothing when I use double quotes, single quotes can be used.

#1264479

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jason,

What is the boxxy-blurb = parameter, could you provide a screenshot of the exact usage for me on the backend ?

Thanks,
Shane

#1264507
blurb.png

Please see attachment. We create multiple style displays to be interpreted and we are having issue with double quotes in fields through out and since we make our assignments using var="" we know this is the culprit but dont know a way to escape these quotes or convert them to html entities.

#1264605

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jason,

The field [types field='boxxy-blurb' output='raw'][/types] is WYSIWYG field correct?

Remember your WYSIWYG field will output with all its formatting. I would not recommend using a WYSIWYG field value in a view filter as this won't work.

Thanks,
Shane

#1264615

Yes this is correct. So are you saying if we change it to a text editor we can use both single and double quotes? Thank you

#1264639

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jason,

What exactly is the text that is inside the WYSIWYG editor, I see that you are using shortcode parameters to filter your view.

Please let me know see a screenshot of the text in the editor.

Thanks,
Shane

#1264641

This is what causing the blurb to not display, when double quotes are added. If I remove "Kindness is preferred." or change it to 'Kindness is preferred.'. Im assuming this causes the break because

boxxy-blurb=" 'Kindness is preferred.' " is syntactically correct when rendered while boxxy-blurb=" "Kindness is preferred." " is not.

I just wish there was a way to change those quotes to " So i would appear as boxxy-blurb=""Kindness is preferred.""

#1264643
double-quotes.png

Screen shot

#1264653

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jason,

Not sure why you would want to filter for an entire sentence but this wouldn't isn't recommended as you need raw texts for the filter to work correctly.

This would mean no special characters should be in the text used to filter the views.

Thanks,
Shane

#1264661

Yes, I noticed you said filter before, we aren't filtering we are bringing in the value of that blurb so that we can display it based on the users specs. We have all different kinds of views. So its not filtering, we're storing the data so that we can use it within a view. For example

Title = "hello world"
Description = "hello back 'Shane'"
Style= "Vertical Box"

The user can change the "Stle" in the admin console to whatever they want to so that the title and description display the way they want. So we are storing those values and then using them in a larger view to display the message based on style. We are stuck with "Description" because description can't have double quotes.

#1264683

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jason,

I see what you mean now but because of the missmatch of quotes it won't work, because you are pretty much passing a text into the view.

Remember your view is using double quotes for the parameter, then single quotes for the parameters inside the shortcode then in that value there are another set of quotes.

Maybe you can write the quotes as ASCII .
hidden link

Please try this and let me know the results.

Thanks,
Shane

#1264691

Ok final question, So there are no special functions or attributes like "output='raw'" provided by Toolset that will convert them for us? Thanks

#1264695

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jason,

No there isn't . The output raw will just give you the raw data that is stored in the field without any pre-formatting

Thanks,
Shane

#1264697

My issue is resolved now. Thank you!