Search
Other Articles Anywhere questions
Forum

Add class to article

Thomas Thrane's Avatar Thomas Thrane
Hi

Maybe I'm blind, but didn't find the option to add a class to {article title="Nærværende og individuel hjælp"}{/article}, so I can target an article, if more are inserted into the same article.
Like {article class="article" title="Nærværende og individuel hjælp"}{/article}

Can this be done?

Kind regards
Thomas
Peter van Westen's Avatar Peter van Westen ADMIN
Just surround the tag in a div with the class:
<div class="article">
{article title="Nærværende og individuel hjælp"}{/article}
</div>
Or when you have multiple articles you could do:
{article category="Animals"}
<div class="article">
   [article]
</div>
{/article}
You could even a unique ID:
{article category="Animals"}
<div class="article" id="article-[id]">
   [article]
</div>
{/article}
Please post a rating at the Joomla! Extensions Directory
Thomas Thrane's Avatar Thomas Thrane
Thanks, but then my customer will have to go into the code instead of "just" adding a class in the editor - no other way?
Peter van Westen's Avatar Peter van Westen ADMIN
Crate a template override for the article view.
By default, Joomla already wraps articles in a div with classes ("com-content-article").
If your setup doesn't, then your template is overriding the article view. Ask your template developer for help then.
Please post a rating at the Joomla! Extensions Directory
Thomas Thrane's Avatar Thomas Thrane
Thank you!
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription