[TYPO3-RTE] link doesn't support 2 classes

Peter Klein peter at umloud.dk
Fri Mar 6 14:14:30 CET 2009


Hi Thomas.
This is due to how the typolink function works, as it supports 4 parameters, 
each seperated by a space.

1st parameter is the uid/link
2nd parameter us the target (optional)
3rd parmeter is the class (optional)
4th parameter is the title (optional)

So in your case with the links, it will be saved in the RTE as:

<link 3 - first second>

which would then be translated to:
<a href="..." class="first" title="second">...</a>

If you add an non target/class/title parameter to the link it would either 
be deleted (HTMLArea) and the link saved as a <link> pseudotag, or saved as 
a <A href> tag (TinyMCE RTE) and processed by the special userFunc.

--
Peter

"Thomas Allmer" <at at delusionworld.com> wrote in message 
news:mailman.1.1236084649.3307.typo3-project-rte at lists.netfielders.de...
> hey,
>
> I just found out that if you create something like this in an rte[1]
> <a href="..." class="first second">...</a>
>
> after save it will be transformed to
> <a href="..." class="first" title="second">...</a>
>
> for <p class="first second">...</p> it works, but for link it doesn't 
> work...
>
> More UseCases:
>
> in RTE:
> <a class="first second" href="22">normal</a>
>
> <a class="first second" href="22" style="padding: 5px;">with style</a>
>
> <a class="first second" href="22" lang="de">with lang</a>
>
> transformed to:
> <a class="first" title="second" href="22">normal</a>
>
> <span style="padding: 5px;"><a class="first" title="second" href="22">with 
> style</a></span>
>
> <a class="first second" lang="de" href="22">with lang</a>
>
> in DB:
> <link 22 - first second>normal</link>
>
> <span style="padding: 5px;"><link 22 - first second>with 
> style</link></span>
>
> <a class="first second" lang="de" href="22">with lang</a>
>
> Conclusion:
> so it's kinda strange that I need to add something like 'lang="de"' to 
> make it work.
>
> It's pretty nasty that the typo3 link doesn't support 2 classes....
>
> I think I could "hack" it for tinymce_rte as it already XCLASS 
> class.t3lib_parsehtml_proc.php and post modify links who are valid TYPO3 
> pages.
>
> However is there a nicer way to do it? Like just setting an option that 
> links should always be saved as html and not as TYPO3 link?
>
> Any suggestions? don't need a working solution (although it would be 
> easier) but what do you think about this restriction in the TYPO3 link?
>
> cheers
>
> [1]: tried htmlarea 1.7.9 and tinymce_rte 0.3.1
>
> -- 
> +---------------------------------+-----------------------------------+
> | Thomas Allmer                   |   http://www.delusionworld.com    |
> | E-mail: at at delusionworld.com    |   phone: +43 699 16217064         |
> +---------------------------------+-----------------------------------+ 




More information about the TYPO3-project-rte mailing list