My TYPO3 website uses TYPO3 6.1 with the included RTE. What I want to archive is to wrap links with a DIV when a condition (link has class) it met.
The editor should only do the following:
- Create a new text in the RTE (e.g. "My link")
- Create a new link for the new Text in the RTE
- Select a class for the link (e.g. "myClass")
This results in the following HTML:
<a href="#" class="myClass" title="sometitle">My Link</a>
In the website frontend, I want the user created link to be wrapped with a DIV - but only, if the link has the class "myClass".
I have tried the following
tt_content.text.20.parseFunc.tags.link.typolink.wrap = <div class="anotherClass">|</div>
which wraps all links with the DIV.
Is there a way in TS to only wrap the link, when the editor has selected "myClass" for it?
If not, is there another (editor friendly) way to archive this?
I have already looked at custom userElements and blockformats, but both seems to be too complicated for the editors, since they have to do more than one operation to create a single link with a special styling.
My resulting HTML in the frontend should look like this
<div class="anotherClass">
<a href="#" class="internal-link" title="sometitle">My Link</a>
</div>
My last choise would be to use JQuery - but actually this is'nt a very clean solution so I would prefer a TYPO3/TS solution.
:before
and:after
? – Benjamin