Search
Other Articles Anywhere questions
Forum

Use [customfield:value] in a img tag

Stephan Herby's Avatar Stephan Herby
Hi,
I'm migrating a website from J3 to J4
I have this code in J3 which is working fine :
<img src="images/formations/rate/rate-[commentaire-note output='value'].png" alt="Note : [commentaire-note output='value']/5" width="150" height="28" class="uk-margin-small" />
So I can get the image rate-5.png or rate-4.png depending of has been saved in that fields...
Works great.
When I move this to J4, I modified the code as advised in your doc :
<img src="images/formations/rate/rate-[commentaire-note:value].png" alt="Note : [commentaire-note:value]/5" width="150" height="28" class="uk-margin-small" />
The thing is it is working for the ALT of the image (i get the good value) but not in the IMG for the image. The HTML generated is :
<img src="/mm4/images/formations/rate/rate-%5Bcommentaire-note:value%5D.png" alt="Note : 4/5" width="150" height="28" class="uk-margin-small">
I probably missed something, but can't find what. Any advice ?
Peter van Westen's Avatar Peter van Westen ADMIN
See if your editor is already changing those brackets in the url when saving the article (so inside the html View of the editor).

If so, see if any editor setting can solve it.

If it is not changed there, it is probably due to the system plugin ordering. Try changing the ordering of the plugins in question.
See: regularlabs.com/blog/242-plugin-order-is-important
Please post a rating at the Joomla! Extensions Directory
Stephan Herby's Avatar Stephan Herby
Hi Peter,
one more time I should have look deeper instead of coming here crying!
The "Prepare Content" in the option tab of the module was not activated. Probably de-activated when i migrated from J3 to J4. It's working like a charm now.
Sorry for your time. Problem solved.
regards.
Peter van Westen's Avatar Peter van Westen ADMIN
🙂👍
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription