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

Redvald Hjulstad redvald at mac.com
Sat Oct 13 23:41:35 CEST 2007


Thank you, Christopher, now it is working, and thank for the link to 
typo3apprentice!!!

redvald

Christopher Torgalson skrev:
> 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/
> 


More information about the TYPO3-english mailing list