{Sys_menu} and {Sub_menu} Template Overrides {Sys_menu} and {Sub_menu} Template Overrides
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

{Sys_menu} and {Sub_menu} Template Overrides

Started by gav240z, June 03, 2009, 04:20:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gav240z

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

<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:


<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.


Nibbler

Just add the new definitions into your custom theme.php


// HTML template for sys_menu
$template_sys_menu = <<<EOT
          <ul>{BUTTONS}</ul>
EOT;


and


  // 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;