[TYPO3] How to create menu with page titles as id?

Christopher Torgalson bedlamhotel at gmail.com
Sat Oct 13 23:32:36 CEST 2007


Hi,

On 10/13/07, Redvald Hjulstad <redvald at mac.com> wrote:
> Thank you, but what I am really after is for the ID to be the page
> title, and not the number...


My first question would be "what's the difference?" From the
standpoint of CSS etc, it's absolutly inconsequential what unique
identifier you use. But in fact, using the page Id is probably safer
in the long run since your install can never have any duplicate ids,
but it very well may have duplicate page titles--if this happens, it
could fubar your CSS styles.

In any case, try something like this if you really think the page
title is a better solution, something like this should work:

lib.menu = HMENU
lib.menu {
  1 = TMENU
  1 {
    noBlur = 1
    wrap = <ul id="menu">|</ul>

    NO {
      before.cObject = HTML
      before.cObject {
        value {
          dataWrap = <li id="{field:title}">|
        }
      }
      wrapItemAndSub = |</li>
    }
  }
}

Believe it or not, this stuff is spelled out in elaborate detail in
the TSref. If you need help figuring out how to read the TSref, you
might want to have a look at the article at
http://www.typo3apprentice.com/howto/rtfm/

-- 
Christopher Torgalson
http://www.typo3apprentice.com/


More information about the TYPO3-english mailing list