Skip Navigation

[Resolved] Remove tces-js-style-to-head & tces-js-style-encoded Scripts from View

This thread is resolved. Here is a description of the problem and solution.

Problem:

Remove tces-js-style-encoded embedded CSS styles from content template.

Solution:

You need to design the post view and content template with classic editor, and display the content template with attribute "suppress_filters":

[wpv-post-body view_template="xxxx" suppress_filters="true"]

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body

This support ticket is created 2 years, 10 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.

Our next available supporter will start replying to tickets in about 1.98 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by benjaminJ-3 2 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#2263087

Tell us what you are trying to do?
Remove tces-js-style-to-head & tces-js-style-encoded embedded scripts from View. I've read elsewhere that these have something to do with blocks styling but I have no block styling on these items that needs to show in the view.

Is there any documentation that you are following?
No

Is there a similar example that we can see?
Line 1056: view-source:hidden link

What is the link to your site?
hidden link

#2263277

Hello,

Yes, you are right, they are inline CSS style codes in base64 encoded format, I have checked HTML source codes of the URL you mentioned above, there isn't any "tces-js-style-to-head", but I see two results with "tces-js-style-encoded".

It is for style the view's result in grid layout, I don't think it is a good idea to remove them from view block, and it might conducts unexpected results.

You can add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Our developers will evaluate it

As a workaround, you can design the view with classic editor, for example:
1) Dashboard-> Toolset-> Settings-> General
in section "Editing experience", enable option "Show both the legacy and Blocks interface and let me choose which to use for each item I build".

2) Dashboard-> Toolset-> Views, create the post view with classic editor, and test again.

#2263721

Hi, I never build views with the blocks editor. It's too limited, so this view is already in classic. Is there another workaround to get all of this unnecessary text of the page? We are trying to reach a certain text to HTML ratio (for Google Page Speed) and these long strings are hurting our efforts.

-Thanks!

#2264209

Those scripts/CSS codes are outputted only from blocks editor, If you are using blocks editor to design the content template, please try to switch to classic editor, and test again.

If you need more assistance for it, please provide a test site with same problem, I need to test and debug it in a live website.

#2265167

Thanks for the details, I have done below modifications in your website, edit both post views:
hidden link
hidden link

In section "Loop Editor", change the content template shortcode from:
[wpv-post-body view_template="xxxx" ]

To:
[wpv-post-body view_template="xxxx" suppress_filters="true"]

Please test again, check if it is fixed, thanks

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body
suppress_filters (opt):
'true' | 'false' (default)
If suppress_filters=’true’, all third party (non WordPress) filters hooked into the_content filter will be removed, when retrieving the post body.

#2265579

Ok, that worked. Thank you!