[TYPO3] ATagTitle output -> " instead of "

Christopher bedlamhotel at gmail.com
Fri Mar 10 01:50:52 CET 2006


Hi,

On 3/9/06, JoH <info at cybercraft.de> wrote:
> >> however the quotes in  20.value = " onClick="close()   are
> >> transformed into &quot;.
> >> that is why the a-tag looks like that: <A>... title="page  &quot;
> >> onClick=&quot;close()"...
> >>
> >> i can't use ATagParams...
> >> is there a way to output " instead of &quot;
> >
> > Erm...an onclick event is not going to work inside a title attribute.
> > What are you actually trying to do? It's simple enough to keep Typo3
> > from converting characters to html entities:
> >
> > ### See TSref stdWrap section for more info:
> >
> http://typo3.org/documentation/document-library/references/doc_core_tsref/current/view/5/1/
> > ###
> > temp = TEXT
> > temp {
> >   value = "This sentence is quoted"
> >   htmlSpecialChars = 0
> > }
> >
> > But what you're trying to do looks bizarre...
>
> It might look like that but when you take a closer look you will notice what
> this workaround is going to do ...
> ATagParams hasn't got stdWrap properties but ATagTitle has.
> So the workaround is to close the title with " and then add another
> Parameter for the A-Tag.
>
> This string
>
> " onClick="close()
>
> would be inserted between the "" of the title Tag giving you
>
> title ="" onclick="close()"
>
> Unfortunately every value for the attribute section is parsed with
> htmlspecialchars and this seems to be hardcoded in PHP.
> So no htmlSpecialChars = 0 possible here.
>
> It was just an idea - and I remember it has been working with older versions
> of TYPO3.
> So it seems he will need another workaround.


Oh, I get it. Not a bad approach I suppose.

If the links are identifiable, by css classes or by the id of the
container they live in, this approach will work (since the desired
behaviour is js based anyway):

<!-- HTML -->

<ul id="nav">
  <li><a href="#">Lorem</a></li>
  <li><a href="#">Ipsum</a></li>
  <li><a href="#">Dolor</a></li>
</ul>

// Javascript
<script type="text/javascript">
function close() {
  // whatever...
}

function onClickEventsForLinks() {
  var linkContainer = document.getElementById('nav');
  var linkCollection = linkContainer.getElementsByTagName('a');

  for(var i=0;i<linkCollection.length;i++) {
    linkCollection[i].onclick=close;
  }
}

window.onload=onClickEventsForLinks
</script>

Obviously, this could be adapted if there are links with special
classes by checking for linkCollection[i].className inside the loop...


-Christopher



More information about the TYPO3-english mailing list