[TYPO3-english] Custom class in tmenu according to uid page

Christopher Torgalson bedlamhotel at gmail.com
Mon Feb 22 19:41:10 CET 2010


Hello,

On Mon, Feb 22, 2010 at 8:39 AM, Victor Livakovsky <v-tyok at mail.ru> wrote:
>>>> Hardcoded break point....
>>>> This would be the first site where uids didn't change.
>>>> It might take 2 more minutes to get a flexible solution.
>>>> But would be worth, i.e. less trouble.
>>>
>>> Yes, that's not perfect, but what would you propose for making concrete
>>> page be wrapped with certain class? OptinSplit not a solution, because page
>>> can appear anywhere in menu.
>>> You mentioned something about alias. Can you explain, please?
>>
>> There is a field called alias in the page properties. It can be used for
>> simulate static contend to get an URL different from the page title.
>>
>> So if simulate static is not used (e.g. due to realurl) this field could
>> be used to provide a classname instead.
>>
>> quick draft:
>> NO.outerWrap.cObject = COA
>> NO.outerWrap.cObject {
>> 10 = TEXT
>> 10 {
>> field = alias
>> wrap=<div class="|">
>> }
>> 20 = TEXT
>> 20.value=|</div>
>> }
>>
>> should work so or similar
>
> Ah, that's nice! Never thought about such possibility.
> Thank you for an explanation :)


Rather than introducing a whole new div, you could also use either of:

  ### Add a class to the link:
  NO.ATagParams.dataWrap = class="{field:alias}"

...or...

  ### Add a class to the list-item:
  NO.wrapItemAndSub.dataWrap = <li class="{field:alias}">|</li>

Also, since the alias field's contents should be unique, you could
output it as an id instead of a class if that suits your use-case.

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


More information about the TYPO3-english mailing list