forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: gav240z on June 03, 2009, 04:20:51 pm

Title: {Sys_menu} and {Sub_menu} Template Overrides
Post by: gav240z on June 03, 2009, 04:20:51 pm
Hi Guys,
I'm confused by {Sys_menu} and {Sub_menu}. I want to be able to theme each menu and have them output as <ul><li> items.

Here is my gallery: http://www.viczcar.com/gallery/

Currently they are just output

Code: [Select]
<a title="Go to the home page" href="/">Home</a>
::
<a title="Go to my personal gallery" href="index.php?cat=10002">My gallery</a>
::
........

But I want them to look like:

Code: [Select]
<ul>
<li><a href="">..</a></li>
<li><a href="">..</a></li>
<li><a href="">..</a></li>
</ul>

If I can get them into list items I can easily create a XHTML /CSS button and make the menu's more user friendly.

Can anyone help me with a theme.php override that will allow me to create simple lists like this?

I read this thread: http://forum.coppermine-gallery.net/index.php/topic,26897.0.html but it didn't really help me. (I also looked into the sample theme folder and its theme.php) but couldn't work it out.

 
Title: Re: {Sys_menu} and {Sub_menu} Template Overrides
Post by: Nibbler on June 03, 2009, 04:53:29 pm
Just add the new definitions into your custom theme.php

Code: [Select]
// HTML template for sys_menu
$template_sys_menu = <<<EOT
          <ul>{BUTTONS}</ul>
EOT;

and

Code: [Select]
  // HTML template for template sys_menu buttons
  $template_sys_menu_button = <<<EOT
  <!-- BEGIN {BLOCK_ID} -->
        <li><a href="{HREF_TGT}" title="{HREF_TITLE}">{HREF_LNK}</a></li>
  <!-- END {BLOCK_ID} -->
EOT;