Skip Navigation

[Resolved] Code gets changed after saving layout

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

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. 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 10 replies, has 2 voices.

Last updated by indianplayschools 7 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#474174

I am trying to: edit the code in visual editor placed in layouts. After saving I see that code is getting changed. This is in continuation with https://toolset.com/forums/topic/how-to-convert-custom-field-image-to-header-image-for-that-custom-post/
A temporary fix was suggested by writing the code in content template and calling that into layout. But now I see that the code in content template also gets changed.
For example,
<div style="background-image:url('[types field="image-background" output="raw"][/types]')">
...
</div>

when pasted and saved , the code looks like this

<div style="background-image:url('[types field=" image-background"="" output="raw" ][="" types]')"="">
...
</div>

="" gets added at places and the functionality of code is not achieved. May I know why this is happening? What can I do to fix this?

Thanks in Advance

#474395

Dear indianplayschools,

I can duplicate same problem, and escalate it to our 2nd supporters. Currently, please try as I mentioned in your thread:
https://toolset.com/forums/topic/how-to-convert-custom-field-image-to-header-image-for-that-custom-post/#post-472486

Edit the content template directly:
hidden link

And setup HTML codes in above URL.

#474447

Hello Luo Yang,
Thanks for the update. The previous solution no longer works. The code changes even when I upload through content template. I will wait for the solution. Thanks a lot

#474453

I just tested in your website:
hidden link

And it works fine, but I guess you will need to update this content template again, everytime after you have edit/update your layout.
hidden link

And it is a temp workaround, so you can also wait for the fix from our developers.

#474466

Sorry, but this is the output
hidden link
Please check.
I understand that previously it worked.

#474471

I can not find the custom image field "image-background" in your website, so I replace it with another image field "image", edited the content template:
hidden link
To:

<div style="background-image:url('[types field='image' output='raw'][/types]'); height:400px;">
...
</div>

Test the problem page again, seems it works fine now:
hidden link

#474631

Yes. Now it is working. Thank You.
Now I see that my code is not being changed even if I paste this code in visual editor. So, I am able to achieve the results even without content template. Have you changed anything? Any guesses what might have gone wrong before?

#475119

It is strange, I did not change anything. I can duplicate same problem in my localhost, and this ticket has already been put into our to-do list, our developers are working on it.

#475164

I am closing the thread as I no longer face the problem.
Thank you very much

#475668

Here is the feedback from our 2nd supporters:
Correct is:

<div style="background-image:url('[types field='image-background' output='raw'][/types]')">
...
</div>

And with that it works. This is autogenerated

#475822

Thank You very much

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