*{**** There needs to be better way, not happy how it's done, but still better to having static menus, this one controlls ALL menus on the webpage. It's not easy to orient in, but it's the ONLY menu we need to take care of. ****}* *{****Setting up the variables, not good way and need to find way to reverse route to get the links like @{MyHome.myHomeIndex()} into variables ****}* #{set myHomeIcon:'home'/} #{set myHomeTitle:'My home'/} #{set myHomeLink:'/myHome'/} #{set myProfileIcon:'user'/} #{set myProfileTitle:'My profile'/} #{set myProfileLink:'/myProfile'/} #{set myEditProfileIcon:'edit'/} #{set myEditProfileTitle:'Edit profile'/} #{set myEditProfileLink:'/myProfile/edit'/} #{set myBlogIcon:'bullhorn'/} #{set myBlogTitle:'My blog'/} #{set myBlogLink:'/myBlog'/} #{set myDashboardIcon:'dashboard'/} #{set myDashboardTitle:'My dashboard'/} #{set myDashboardLink:'/myDashboard'/} *{****Checking if selected options for logged users or the unlogged ones ****}* #{if activePage == 'accountsWelcome' || activePage == 'accountsLogin' || activePage == 'accountsSignup'} #{set loggedIn:false/} #{/if} #{else} #{set loggedin:true/} #{if activePage == 'blogs' && !user} #{set loggedin:false/} #{/if} #{/else} *{**** Will know if any of my**** options is selected, if it's selected and myHome is not selected then I can write the myHome into the pulldown submenu. It's working around fact that myHome is displayed on the top when some other my***** options are selection but even when som other items are selected like members, or public blogs, but then in that case it's not as active and we need to distingish it when that happens. ****}* #{set mySelected:false/} *{**** Prepare the top item for the dropdown menu ****}* #{if activePage == 'myProfile'} #{set topLink=""+ myProfileTitle +"   "/} #{set mySelected:true/} #{/if} #{elseif activePage == 'myProfileEdit'} #{set topLink=""+ myEditProfileTitle +"   "/} #{set mySelected:true/} #{/elseif} #{elseif activePage == 'myBlog'} #{set topLink=""+ myBlogTitle +"   "/} #{set mySelected:true/} #{/elseif} #{elseif activePage == 'myDashboard'} #{set topLink=""+ myDashboardTitle +"   "/} #{set mySelected:true/} #{/elseif} #{else} *{**** In case it's myHome show myHome, if it's anything else still create the top dropdown item for myHome but it won't be active ****}* #{set topLink=""+ myHomeTitle +"   "/} #{if activePage == 'myHome'} #{set mySelected:true/} #{/if} #{/else} *{**** Depending if you are logged in or not, will show some items, or hide some items ****}*