[TYPO3] TMENU with title and subtitle as tooltip

Christopher bedlamhotel at gmail.com
Thu Feb 2 16:37:37 CET 2006


On 2/2/06, Gregor Kaczmarczyk <gregor at crazes.de> wrote:
> hi Christopher,
>
> Christopher schrieb:
> > Why not try:
> >
> > ATagTitle.field = title // subtitle [1]
> i don´t think this helps. if i understand right, this statement would fill
> the links with subtitle if there is no title for the page.


Nope. It will produce links as usual, but with the TITLE ATTRIBUTE
filled with either of title/subtitle:

<a href="foo/" title="More about foo!">Foo</a>
<a href="bar/" title="An introduction to bar...">Bar</a>

This will produce a tooltip in every visual brower I know about, and
will fill it with the output of whatever field you specify--the link
text will still be the page title.


> maybe it wasn´t clear what i want to achieve.
> i need the following ouitput:
> <li><a href="#">Link 3<span class="tooltip"> Tooltip 3</span></a></li>
> so i need title _and_ subtitle.
> but the tooltip-span should only be rendered if the subtitle was filled.
>
> my TS-snippets is working but i get wrong order of title and subtitle:
> <li><a href="#"><span class="tooltip">Tooltip 3</span>Link 3</a></li>
>
> anybody a idea how this can be achieved?


If you want to do this instead, you're going to have to take this
basic approach (a bit long for me to write out completely):

NO {
  doNotShowLink = 1

  cObject = COA
  cObject {
    # Note that it'd probably be better to wrap the  COA in just
<li>|</li> and build the link
    # as a TEXT or HTML object and use .typolink to generate the link:

    dataWrap = <li><a href="index.php?id={field:uid}">|</a></li>

    5 = TEXT
    5 {
      # Properties for the <span> here; display it conditionally using '.if'
      # (http://typo3.org/documentation/document-library/doc_core_tsref/if/)
      #
      # Note that there is probably no good reason to use a class on the  span
      # (i.e. since there is probably an id on the whole menu object
and the spans
      # can be targeted in css with #menuId li a span { /* Tooltip
properties */ })

      field:subtitle
      wrap = <span>|</span>
      if.isTrue.data = field:subtitle
    }

    10 = TEXT
    10 {
      # Properties for the link title here; probably something like:

      data = field:title
    }

  }
}

Not tested, and it's early so there may be errors, but something along
these lines will do it.



-Christopher



More information about the TYPO3-english mailing list