Search
Other Articles Anywhere questions
Forum

Joomla 4: custom field with :value outputs only path of custom media field

Thomas Venugopal's Avatar Thomas Venugopal
I'm converting my content to J4 syntax. Currently, I'm using this:
{articles category="267" id="input:ba" empty="<img src="/fallback.png" alt="" />"}[badge layout="false"]{/articles}

This works as expected. It outputs just the media custom field "badge" as an image.

When I migrate to Joomla 4 and converting the syntax to:
{articles category="267" id="input:ba" empty="<img src="/fallback.png" alt="" />"}[badge:text]{/articles}

or
{articles category="267" id="input:ba" empty="<img src="/fallback.png" alt="" />"}[badge:value]{/articles}

as described in the documentation and the blog but it outputs just the path.

Is this expected behavior, am I doing something wrong or is this a bug or is this related to this? regularlabs.com/forum/articlesanywhere/5...ange-url-in-joomla-4
Peter van Westen's Avatar Peter van Westen ADMIN
What are you trying to output?
I guess 'badge' is a Media field...
Please post a rating at the Joomla! Extensions Directory
Thomas Venugopal's Avatar Thomas Venugopal
This works as expected. It outputs just the media custom field "badge" as an image.

Yes.

PS: I corrected the Topic headline.
Peter van Westen's Avatar Peter van Westen ADMIN
This is expected behavior. You are telling it to output just the value.
If you want to render the image of the custom field itself, use [badge].
Please post a rating at the Joomla! Extensions Directory
Peter van Westen's Avatar Peter van Westen ADMIN
To output just an image, either use a custom field layout, or create the image tag yourself and insert the [badge:url] into the src attribute.
Please post a rating at the Joomla! Extensions Directory
Thomas Venugopal's Avatar Thomas Venugopal
When I use only [badge] in Joomla 4 it returns nothing, only the fallback works when triggered via URL parameter.
Thomas Venugopal's Avatar Thomas Venugopal
This info is not in the migration guide, maybe this could help others too:
The Joomla 3 version of Articles Anywhere also had the ability to customize the output specifically related to the "value" part of a custom field.

This feature has been removed from the Joomla 4 version, as we now made it easier to achieve the same result via different methods.

docs4.regularlabs.com/articlesanywhere/g...youts-layout-example

In the migration guide it says to just replace layout="false" to :value

docs4.regularlabs.com/articlesanywhere/g...m-joomla3-to-joomla4

For a media custom field it seems to be a little bit different.
Peter van Westen's Avatar Peter van Westen ADMIN
Yes, correct. Media fields act a bit different.
Please post a rating at the Joomla! Extensions Directory
Thomas Venugopal's Avatar Thomas Venugopal
Ok, I will change the setup to urls…
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription