Search
Other Articles Anywhere questions
Forum

[Solved] Adding a html tag when using article editor button

Nicolas OLIVIER's Avatar Nicolas OLIVIER
Hi,
We need to add a div with a class when the user use the article button for adding some nice style on it. We can even image adding some text etc I don't see where to do that properly. Maybe with adding some before/after options in the system plugin "Button settings" could do the trick.
Peter van Westen's Avatar Peter van Westen ADMIN
The Articles Anywhere editor button does not provide that functionality.
Please post a rating at the Joomla! Extensions Directory
Nicolas OLIVIER's Avatar Nicolas OLIVIER
Okay, so if we can't disting in HTML code the insertion of an article by the AA plug-in, we have to "hack" your code to find where you add the START: Articles Anywhere and END: Articles Anywhere or there is something we can override for doing that ?
Peter van Westen's Avatar Peter van Westen ADMIN
You could use ReReplacer to add html code to your HTML output.
For instance, replace those start and end comment tags with something else, like:
Replace:
< !-- START: Articles Anywhere -- >
With:
<div class="my-special-class">< !-- START: Articles Anywhere -- >
And replace:
< !-- END: Articles Anywhere -- >
With:
< !-- END: Articles Anywhere -- ></div>

PS: I added extra spaces in the comment tags here to prevent them from being hidden ?

See: regularlabs.com/rereplacer
Please post a rating at the Joomla! Extensions Directory
Nicolas OLIVIER's Avatar Nicolas OLIVIER
Okay thanks, it's a full Regular Labs solution ^^ Do you have any idea of the perf inpact of Rereplacer because I supose it's a parsing of the $item object just before rendering.
Peter van Westen's Avatar Peter van Westen ADMIN
I recommend setting the ReReplacer item Search Area to 'Everywhere' or 'Body'.
It will do the replacement on the final HTML output.

The impact of ReReplacer on the rendering speed - unless you go crazy with hundreds of heavy Regular Expression based searches - should not be noticeable.
Please post a rating at the Joomla! Extensions Directory
Nicolas OLIVIER's Avatar Nicolas OLIVIER
Thanks for your help !
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription