Search
Other Articles Anywhere questions
Forum

custom field (article) with custom html and Template

Steffen's Avatar Steffen
Hi Peter,

I have migrated a J3 installation to J4 including my RegularLabs extension. The portal worked with some overrides of the protostar template.
I am currently trying to recreate and adapt these overrides under cassiopeia. The data transfer of the RegularLabs extensions worked great.

In some custom fields (type: articles) I have the following code under layout incl. reference to a special template.
{article id="[id]" layout="Cassiopeia_tdbl:tdbl-field"}<div class="tdbl-text lt-text">[text]</div>{/article}

The layout seems to be ignored here. The render.php loaded under components/com_fields/layouts/field .

The specification of the special template seems to be ignored here. I can't get my template template/cassiopeia_tdbl/html/com_content/article/tdbl-field.php to load.

I have also tried field overrides. These are used, but the output does not seem to be via the customised template for this article.

What am I doing wrong here - compared to Joomla3?

Greetings Steffen
Peter van Westen's Avatar Peter van Westen ADMIN
You are using an Articles Anywhere tag. That does not support a layout attribute in the tag itself.
When using Articles Anywhere to output a custom field, you need to add the layout attribute to the data tag referencing that custom field.
docs4.regularlabs.com/articlesanywhere/g...in-articles-anywhere

BUT, I think you just want the Article Field to render via your custom layout. That should be done via the layout setting in the field itself. Not sure why you also want to use the custom output...
Please post a rating at the Joomla! Extensions Directory
Steffen's Avatar Steffen
hello Peter,

When I built the portal back then under J3, we also had contact on this issue and I managed to make it work perfectly.

Short explanation:
I can design product data sheets via this portal.
A product (item of the Cat product) consists of several texts (item different Cat "texts") and custom fields (images etc.).
A similar product can then also contain the same texts and perhaps only a modified text block (technical data, for example).
This way the system is modular, a text change will automatically change all products that contain this item.
I hope I was able to explain it clearly.

But I have to solve it somehow via an article override, because I can edit the data sheets in the frontend and in logged-in mode even more information is displayed.
You are welcome to have a look at it, I will send you an access.

To cut a long story short, I can't manage to create the functionality with J4.

with this code:
[div class="tdbl-text td-text"][layout template="protostar" layout="tdbl-field"][/div]
in the custom html of the custom field i was able to output exactly the fulltext of the assigned post in my override.

Maybe you have a more precise tip for me.

Thanks


Confidential information:
(hidden)
Peter van Westen's Avatar Peter van Westen ADMIN
Sorry, but I can't wrap my head around your complete setup and project. Also, it is beyond my support to try and have to do that.

If you want to output the article via Articles Anywhere using a different layout than the default, you can do that as explained here:
docs4.regularlabs.com/articlesanywhere/d...a#alternative-layout
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