[TYPO3-english] Hilighting restricted pages in HMENU/TMENU

Sergey Alexandrov serg at alexandrov.us
Wed May 15 16:33:15 CEST 2013


A long time ago I did something like this:

temp.fakemenu = HMENU
temp.fakemenu {
     special = directory
     special.value = pid_of_secured_pages
     1 = TMENU
     1 {
          NO.allWrap = <div class="menu-divl-1">|</div>
          NO.ATagBeforeWrap = 1
          NO.ATagParams = class="menu-href-1"
          NO.stdWrap.htmlSpecialChars = 1
     }
}

[loginUser = *]
[else]
    temp.fakemenu.1.NO.doNotLinkIt = 1
    temp.fakemenu.1.NO.linkWrap = <a href="javascript:alert('You have to 
be logged in to access this page')" class="menu-href-1">|</a>
[global]

On 5/15/2013 10:24 AM, Alban Cousinie wrote:
> Hello everybody,
>
> As you know, when a frontend user is authenticated in Typo3, the 
> restricted pages will show up in the TMENU. If he is not 
> authenticated, those will be masked.
>
> Now I would like to experiment a different behavior : the restricted 
> page would have different css style in the menu so the user can see 
> very quickly these are restricted pages. Also they would appear with 
> no lonk for unauthenticated users, so they know that they will have 
> access to more information when they become members of the website.
>
> Does anyone have a clue of how to implement this ? I don't see any TS 
> instruction for processing separatly pages based on their properties 
> in the TMENU reference. At least I would like to add a class="members" 
> attribute to menu entries of restricted access pages.
>
> Here is my navigation code so far :
>
> lib.field_navigation = HMENU
> lib.field_navigation.special = directory
> lib.field_navigation.special.value = 1
> lib.field_navigation.1 = TMENU
> lib.field_navigation.1.wrap = <ul id=mainNavUL>|</ul>
> lib.field_navigation.1 {
>  expAll=1
>  NO {
>        allWrap=<li>|
>        #ATagParams = href="javascript:return false;" 
> class="navLevel2Rest"
>        ATagBeforeWrap=1;
>  }
>  ACT = 1   ACT {
>        allWrap=<li>|
>        #ATagParams = href="javascript:return false;" 
> class="navLevel2Rest current"
>        ATagBeforeWrap=1;
>  }
> }
> lib.field_navigation.2 = TMENU
> lib.field_navigation.2 {
>    expAll=1
>  wrap=<ul>|</ul></li>
>  NO {
>       allWrap=<li>|
>        ATagBeforeWrap=1;
>  }  }
>
> lib.field_navigation.3 = TMENU
> lib.field_navigation.3 {
>    expAll=1
>  wrap=<ul>|</ul></li>
>  NO {
>       allWrap=<li>|</li>
>        ATagBeforeWrap=1;
>  }  }
>
> Thanks
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english



More information about the TYPO3-english mailing list