Thursday 24 November 2005 9:02:41 pm
Hi all, I've been racking my brain trying to get this working, so this is my last resort. I would like to create a "My Account" menu for my users similar to the one in the admin area (left hand menu when in My Account), this way when a user is logged in they can go to their account settings and a menu will be present. In the menu I need a link to change notification settings, user profile and a couple of other links like a help link where they can get info on how to edit their account etc. I've been looking in the admin templates and I have found in the pagelayout.tpl the code that performs this in the admin area, however I have so far been unsuccessful adapting it to the front end. This is the code from admin pagelayout.tpl
{section show=and( eq( $ui_context, 'edit' ), eq( $ui_component, 'content' ) )}
{section-else}
<div id="leftmenu">
<div id="leftmenu-design">
{section show=and( $ui_context|eq( 'edit' ), $ui_component|eq( 'content' ) )}
{include uri='design:edit_menu.tpl'}
{section-else}
{section show=eq( $navigation_part.identifier, 'ezcontentnavigationpart' )}
{include uri='design:parts/content/menu.tpl'}
{/section}
{section show=eq( $navigation_part.identifier, 'ezmedianavigationpart' )}
{include uri='design:parts/media/menu.tpl'}
{/section}
{section show=eq( $navigation_part.identifier, 'ezshopnavigationpart' )}
{include uri='design:parts/shop/menu.tpl'}
{/section}
{section show=eq( $navigation_part.identifier, 'ezusernavigationpart' )}
{include uri='design:parts/user/menu.tpl'}
{/section}
{section show=eq( $navigation_part.identifier, 'ezvisualnavigationpart' )}
{include uri='design:parts/visual/menu.tpl'}
{/section}
{section show=eq( $navigation_part.identifier, 'ezsetupnavigationpart' )}
{include uri='design:parts/setup/menu.tpl'}
{/section}
{section show=eq( $navigation_part.identifier, 'ezmynavigationpart' )}
{include uri='design:parts/my/menu.tpl'}
{/section}
{/section}
</div>
</div>
<hr class="hide" />
{/section}
What I need is something like this:
{section show=and( eq( $ui_context, 'edit' ), eq( $ui_component, 'content' ) )}
{section-else}
{section show=eq( $navigation_part.identifier, 'ezmynavigationpart' )}
{include uri='design:parts/my/menu.tpl'}
{/section}
{/section}
The problem is that this won't display the menu, but if I put this in my pagelayout.tpl:
{include uri='design:parts/my/menu.tpl'}
The menu shows up but it is on every page and it makes no difference if I'm logged in or not.
I beleve the answer lies in the ui_context and ui_component, I have read the doc on these but it makes little sence to me: http://ez.no/download/changelogs/ez_publish_3_5/ui_context_variables Does anyone have any idea how I can get this working? Any help is very appreciated. Cheers!
Pardon me while I burst into flames...
|