Skip Navigation

[Résolu] Code gets changed after saving layout

This support ticket is created Il y a 7 années et 8 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Ce sujet contient 10 réponses, a 2 voix.

Dernière mise à jour par indianplayschools Il y a 7 années et 8 mois.

Assisté par: Luo Yang.

Auteur
Publications
#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:
lien caché

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:
lien caché

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

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

#474466

Sorry, but this is the output
lien caché
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:
lien caché
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:
lien caché

#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

Ce ticket est maintenant fermé. Si vous êtes un client de Toolset et que vous avez besoin d'aide, veuillez ouvrir un nouveau ticket d'assistance