[TYPO3-english] Get current page ID in menu.

Radoslav Kolarov radoslav.kolarov at osceola.de
Thu Oct 29 17:18:10 CET 2009


Hi Christopher,

Thanks for you suggests. I found also that if you do not specify 
special.value the default value is current page. For the entryLevel - 
yes it is not needed. Thanks.
For menu code - I need this subpages menu in other place than main 
menu(where the subpages are also there with ajax code). So thats why I 
need this menu as separate lib.

Greets

Christopher Torgalson wrote:
> Hi there,
>
> On Thu, Oct 29, 2009 at 2:20 AM, Rudy Gnodde (WIND Internet)
> <rgn at windinternet.nl> wrote:
>   
>> Hello Radoslav,
>>
>> Radoslav Kolarov wrote:
>>     
>>> Hi, I need to get current page in menu to make it dynamic. Here is the
>>> code:
>>>
>>> ...
>>> special = directory
>>> special.value = [current_page_id]
>>> entryLevel = 0
>>> .....
>>>
>>> So I'll show the subpages of current page in this menu.
>>> Please tell me how to get this pageid.
>>> Thanks
>>>       
>> special.value has stdWrap, so you can set special.value.data = TSFE:id. I
>> haven't tried it, but something like that should work.
>>     
>
>
> While this is true, there should be no need for any such code to make
> subpages of a menu show since this is the *default* behaviour.
>
> Radoslav, I don't know if it's the source of whatever problem you're
> having, but your TS contains an error. The .special property and
> .entryLevel should NOT be used together. See the TSref:
>
> "NOTE: Don't set .entryLevel for a HMENU when using this [.special]
> option! Also be aware that this selects pages for the first level in
> the menu. Submenus by menuPbjects 2+ will be created as usual." [1]
>
> A basic TS menu with two levels of subpages just looks like this:
>
> lib.some_menu = HMENU
> lib.some_menu {
>   special = directory
>
>   1 = TMENU
>   1 {
>     noBlur = 1
>     wrap = <ul id="some-menu">|</ul>
>
>     NO {
>       wrapItemAndSub = <li>|</li>
>     }
>
>     CUR = 1
>     CUR {
>       ATagParams = class="current"
>     }
>   }
>
>   2 < .1
>   2.wrap = <ul>|</ul>
>
>   3 < .2
> }
>
> Try adapting that menu and if you still have problems reply back to this thread.
>
> [1] http://typo3.org/documentation/document-library/references/doc_core_tsref/4.2.0/view/1/8/#id4251386
>
>   



More information about the TYPO3-english mailing list