[opencms-dev] problem in creating menus

Christian Steinert christian_steinert at web.de
Fri Aug 11 13:52:31 CEST 2006


Vikas Gupta schrieb:
> Hi All,
>  
>   Here is complete details regarding my problem to create drop down
> menus. Please let me know if anyone have Idea
> 
> *
> Problem in creating dynamic menu: *
> 
>  
> 
> CMS:               OPENCMS / Version: 6.0.2
> 
> Database:         MYSQL / Version: 5.x
> 
> Server:             Tomcat / Version: 5.0
> 
> JDK:                1.5
> 
>  
> 
>  
> 
> *Scope of work:*
> 
> * *
> 
> *    *Create a dynamic menu on my template page. Menu should be editable
> later.
> 
> * *
> 
> * *
> 
> *Queries:*
> 
> * *
> 
> *How many ways are there to create a dynamic menu which should be editable?*
> 
> * *
> 
> * *
> 
> *My approach:*
> 
>  
> 
> I have created a module in opencms. Than I have created a jsp template
> in templates folder. Code that I am using to include a page for
> navigation is:
> 
>  
> 
> /* This code is a part of my template */
> 
>  
> 
>  <tr align="right">
> 
>     <td width="114"
> style="background-color:#525252;height=36px;"> </td>
> 
>     <td style="background-color:#FFFFFF; height:195px;">
> 
>    <%    
> 
>     cms.include("../elements/nav_head.jsp", null, cms.getProperties());
> 
>    %>
> 
>     </td>
> 
>     <td width="115"
> style="background-color:#525252;height=36px;"> </td>
> 
>    </tr>
> 
>  
> 
>  
> 
> In this template I have created a row which includes nav_head.jsp file
> and the code of nav_head.jsp file which I have written is:
> 
>  
> 
>  
> 
> /* This code is a part of nav_head.jsp */
> 
>  
> 
> CmsTemplateNavigation cms = new CmsTemplateNavigation(pageContext,
> request, response);
> 
>  
> 
> // set the default property value to create head navigation menu items
> 
> // true: all folders and files without the property
> "style_head_nav_showitem" explicitly set will be shown in head
> navigation menu
> 
> // false: no folder or file without the property
> "style_head_nav_showitem" explicitly set will be shown in head
> navigation menu
> 
> cms.setHeadNavItemDefaultValue(true);
> 
>  
> 
> out.print(cms.buildNavigationHead(cms.key("link.home"), "navtop",
> "navspacer"));
> 
>  
> 
>  
> 
>  
> 
> This creates a menu with following problems:
> 
>  
> 
>    1. At first request, Menu is not displaying. While copying url and
>       run the page on another browser, It is displaying.
> 
>  
> 
>    2. Menu items are the folder and pages of located at /sites/default/
>       and startFolder is always root ( / ).
> 
>  
> 
>       How can I change this startFolder to my folder?                     
> 
>       How can I add pages that exist in my module?
> 
>  
> 
>  
> 
> One more thing I want to know. I need to add images or some style to my
> main menu bar. Is it possible?
> 
> 
> Thanks & Regards
> Vikas Gupta
> 
> 

This is a Html question, not an opencms question.

You should read sites like alistapart.com and search there for
"dropdown" if you want to learn about menu-creation with
HTML/CSS/Javascript.

Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060811/7340a1ed/attachment.bin>


More information about the opencms-dev mailing list