[TYPO3-english] Page in multiple menus - ACT and CUR state

Daniel Huf d.huf at theoreme.ch
Tue Aug 7 10:53:32 CEST 2012


So my solution should work.

I had the problem that the main menu is not created with pages from the 
same level...

so I create a sys_folder to generate my main menu only with shortcuts...

I didn't try with multilingual site, you might have to add some 
syslanguage-id or so.

Good luck,
Daniel

On 8/7/12 10:37 AM, Ulrich Witschass wrote:
> Thank you,
>
> I will try that one out!
>
> I tried both CUR and ACT before to no avail.
>
> I also noticed that my problem description was not entirely correct.
>
> To illustrate it better:
>
> Menu A (with the "real" pages in it):
> .
> .
> Page X
> .
> .
>
> Menu B (with the Shortcuts)
> .
> .
> Shortcut to Page X
> .
> .
>
> When a user clicks "Page X" ind "Menu A", CUR state is set to Page X in Menu A, but NOT to the shortcut in Menu B.
>
> When a user clicks the shortcut to Page X in Menu B, CUR state is set to Page X in Menu A, and again NOT to the shortcut.
>
> Basically, the system correctly identifies Page X as the current page, but ignores that the shortcut also leads to Page X and does NOT set it to CUR state.
>
> To be honest this, I don't even think this is a bug or anything, but the customer demands that ALL links in the menus are highlighted, and doesn't care about "pages", "shortcuts" etc.
>
> Currently I have fixed it with a rather "ugly" (I suppose) trick:
>
> I run a jquery function which loops through all anchors in Menu B, inspects their href, and if it leads to the same page as the current page, adds the needed css class.
> To quote Mr. Beeblebrox: A million points in style, minus a million in good thinking ;) (plus it breaks when javascript's disabled)
>
> I will try your suggestion and report back!
>
> regards
>
> tuo
>
> ____________________________________________________
>
> GeekTech - Ulrik Witschaß
> Webdesign - Softwareentwicklung - ColorManagement
>
> Mail: uw at geektech.de
> Tel: 06204 918 921
>
> Jahnstraße 16a
> 68519 Viernheim, Deutschland
>
> Diese Nachricht ist nur für den vorgesehenen Empfänger bestimmt. Sollten Sie nicht der vorgesehene Empfänger dieser E-Mail und ihres Inhalts sein oder diese E-Mail irrtümlich erhalten haben, bitten wir Sie, den Absender unverzüglich darüber zu informieren und diese Nachricht und all ihre Anhänge vollständig von Ihrem Computer zu löschen. Jede Form der unbefugten Nutzung, Veröffentlichung, des Kopierens oder der Offenlegung des Inhalts dieser E-Mail ist nicht gestattet.
>
> Bitte denken Sie über Ihre Verantwortung gegenüber der Umwelt nach, bevor Sie diese E-Mail ausdrucken.
>
> This message is intended for the addressee only. If you are not the intended recipient of this e-mail message and its content or have received this e-mail in error, please notify the sender immediately and delete this message and all its attachments. Any form of unauthorized use, publication, copying or disclosure of the content of this e-mail is prohibited.
>
> Please consider your environmental responsibility before printing this mail.
>
>
>
>
> Am 07.08.2012 um 08:38 schrieb Daniel Huf:
>
>> I cheated a bit, but it works for me...
>>
>> As I have shortcuts to pages, I use the destination as a page.
>>
>> temp.mainMenu.pages = CONTENT
>> temp.mainMenu.pages {
>>     table = pages
>>     select {
>>         pidInList = {$PID.menu.main}
>> 	andWhere = hidden = 0 AND deleted = 0
>>     }
>>     renderObj = COA
>>     renderObj {
>> 	10 = TEXT
>> 	10.field = shortcut
>> 	10.wrap = |,
>>     }
>> }
>>
>> And then I use the list of pages as page list for the menu like that:
>>
>> 	20.special = list
>> 	20.special.value.cObject < temp.mainMenu.pages
>>
>> Hope that helps...
>> Good luck, if you find a better way I'd be glad to hear about.
>>
>> Daniel
>>
>> On 8/6/12 12:10 PM, Ulrich Witschass wrote:
>>> Hello Typo3 community,
>>>
>>> I am currently facing the following problem I can't seem to solve:
>>>
>>> The Typo3 Site I currently work on has multiple menus (four, to be exact).
>>>
>>> One of them acts as a "quick link" menu, having shortcuts to pages present in the other menus, like so:
>>>
>>> Menu A (Sysfolder)
>>>    Page 1
>>>     Page 1.1
>>>    Page 2
>>>    Page 3
>>>
>>> Menu B (Sysfolder)
>>>   Page 4
>>>   Page 5
>>>
>>>
>>> Quicklinks (Sysfolder)
>>>   Shortcut Page 1
>>>   Shortcut Page 4
>>>
>>>
>>> It is necessary that if Page 2 in Menu A is clicked, the Entry in the Quicklinks menu also is highlighted (bold), so basically it needs to get the cur state.
>>>
>>> At the moment, it only gets this if the Page is clicked in the Quicklinks menu.
>>>
>>> Basically: regardless where a page is clicked, it should be shown with a CUR class in all menus.
>>>
>>> Is this possible, and if so, how do I achieve this?
>>>
>>> Thanks to all in advance for any and all help provided
>>>
>>> tuo
>>>
>>
>> _______________________________________________
>> 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