You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Marc Lustig <ma...@marclustig.com> on 2002/09/17 13:03:44 UTC

highlighting current menu item

Hi,
I want to have a main menu and a sub menu, in different vm-files, to be
called by my Default.vm layout template.
Within I want to highlight the current menu item that has been selected.
HOw do I get the information which menu-item has been selected?
Read it out of the context?
Using $navigation ?
Or $data.getScreen() ?
Is it possible to write a screen-class for the 2 navigation-templates?
Is there an example how to do this available?

Browsing the archive didn't help.
Thanks,
Marc


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: highlighting current menu item

Posted by Rodney Schneider <ro...@actf.com.au>.
Hi Marc,

We pass around a GET/POST parameter indicating the currently selected 
navigation item (?navitem=blah) and our base Screen class saves this in user 
temporary storage:

data.getUser().setTemp("currentNavItem", navItem);

In our templates we use a pull tool to retrieve the currently selected 
navigation item from user temporary storage so that we know which button 
state to display.

You can see the initial version of our Turbine application at 
http://www.kahootz.com to see how this works.

Regards,

-- Rodney


On Tue, 17 Sep 2002 21:03, you wrote:

> Hi,
> I want to have a main menu and a sub menu, in different vm-files, to be
> called by my Default.vm layout template.
> Within I want to highlight the current menu item that has been selected.
> HOw do I get the information which menu-item has been selected?
> Read it out of the context?
> Using $navigation ?
> Or $data.getScreen() ?
> Is it possible to write a screen-class for the 2 navigation-templates?
> Is there an example how to do this available?
>
> Browsing the archive didn't help.
> Thanks,
> Marc

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: highlighting current menu item

Posted by Derick <de...@xenocex.com>.
Hi,

I used to do this by embedding a variable named tab in the vm file, so the
other vm file could check to see which tab was being used as a screen. like
so:

navigation:
#if( $tab == "search" )
    <menu code/>
#

screen:
#set( $tab = "search"
--------------------------------------------------

I've found it to be less hassle to use the screen template name, like so:
#if( $data.Parameters.Template =="Search.vm" )
    <menucode/>
#end

That way you skip editing the screen..
If your submenu items are linked to the same screen, then I would imagine
you would have to use the first approach.
Hope that answers your question.

:),
Derick

----- Original Message -----
From: "Marc Lustig" <ma...@marclustig.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Tuesday, September 17, 2002 4:03 AM
Subject: highlighting current menu item


> Hi,
> I want to have a main menu and a sub menu, in different vm-files, to be
> called by my Default.vm layout template.
> Within I want to highlight the current menu item that has been selected.
> HOw do I get the information which menu-item has been selected?
> Read it out of the context?
> Using $navigation ?
> Or $data.getScreen() ?
> Is it possible to write a screen-class for the 2 navigation-templates?
> Is there an example how to do this available?
>
> Browsing the archive didn't help.
> Thanks,
> Marc
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: highlighting current menu item

Posted by Rodney Schneider <ro...@actf.com.au>.
On Wed, 18 Sep 2002 20:30, you wrote:

> Just a little question, Rodney about your www.kahootz.com
>
> q 1.  do you run it in tomcat configured on pourt 80 ?
>      in the $TOMCAT_HOME/webapps/ROOT   ?

We run Apache 1.3.26, mod_jk and Tomcat 4.x and the web app is in 
$TOMCAT_HOME/webapps/ROOT...  "/kz/" is our mod_jk mount point, specified in 
httpd.conf.

> q.2 typing  http://www.kahootz.com  loads a yellow page and redirects it
> after a short time  to http://www.kahootz.com/kz/
>
> How one does redirect with a given delay to another screen in turbine?

That is just our Apache index.html file which has the following tag in the 
<head> section:

<META http-equiv="refresh" content="1;URL=/kz/">

This is a 1 second delay, but you can set it to 0 for an instant redirect or 
5 for a 5 second delay.

Regards,

-- Rodney

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: highlighting current menu item

Posted by Slava Zimine <sl...@japgod.mine.nu>.
Just a little question, Rodney about your www.kahootz.com 

q 1.  do you run it in tomcat configured on pourt 80 ? 
     in the $TOMCAT_HOME/webapps/ROOT   ? 


q.2 typing  http://www.kahootz.com  loads a yellow page and redirects it after a short time  to http://www.kahootz.com/kz/

How one does redirect with a given delay to another screen in turbine?


Merci, 

regards,
Slava


> You can see the initial version of our Turbine application at 
> http://www.kahootz.com to see how this works.


> 
> Regards,
> 
> -- Rodney
> 
> 
> On Tue, 17 Sep 2002 21:03, you wrote:
> 
> > Hi,
> > I want to have a main menu and a sub menu, in different vm-files, to be
> > called by my Default.vm layout template.
> > Within I want to highlight the current menu item that has been selected.
> > HOw do I get the information which menu-item has been selected?
> > Read it out of the context?
> > Using $navigation ?
> > Or $data.getScreen() ?
> > Is it possible to write a screen-class for the 2 navigation-templates?
> > Is there an example how to do this available?
> >
> > Browsing the archive didn't help.
> > Thanks,
> > Marc
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>