Customised Menu Links (MAIN_MENU split) Customised Menu Links (MAIN_MENU split)
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Customised Menu Links (MAIN_MENU split)

Started by Puffinstuff, May 05, 2006, 01:59:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Puffinstuff

I have just upgaded to 1.4 disregarding my previous customised theme and all working as should.

Now I am customizing my theme and read in the docs that "{MAIN_MENU} was split into "{SYS_MENU}" and "{SUB_MENU}"

In my old customised theme.php I highjacked? menu links and inserted the following in the theme.php (at the end of // HTML template for main menu


<ul>
                        <li><a href="Services.htm" target="_blank">{LASTUP_LNK}</a> ::</li> // SPB
                        <li><a href="about.htm" target="_blank">{LASTCOM_LNK}</a> ::</li> // SPB
                       
                  <li><a href="links.htm" target="_blank">{TOPN_LNK}</a> ::</li> // SPB
                        <li><a href="contact.htm" target="_blank">{TOPRATED_LNK}</a> ::</li> // SPB
                        <li><a href="about.htm" target="_blank">{FAV_LNK}</a> ::</li>
                        <li><a href="artwork.htm" target="_blank">{SEARCH_LNK}</a></li>

With the split of Main_Menu where would I put this (or am I approaching it incorrectly? (I have searched the whole site for but cannot seem to find similar location to insert).


Paver

Basically, the variable $template_main_menu is now $template_sys_menu and $template_sub_menu.  You can define  these two new variables with straight HTML as before.  Many of the core themes use this approach (e.g. "Hardwired").  You can also define these two new variables using an addbutton() shortcut which is shown in the "sample" theme.

In your case, the simplest thing is to look in a core theme like "Hardwired" and figure out where the buttons you want are, whether in $template_sys_menu or $template_sub_menu, then put the replacements you want in the correct variable.  Looking in the "sample" theme might be a little easier to browse since the addbutton() lines are one after the other, but you might get confused if you try to implement the addbutton() approach without carefully copying the correct parts from the "sample" theme.  See my sticky thread in this forum regarding the "Template Error" to see my discussion on correctly using the new addbutton() shortcuts.

In the end, you're basically copying the parts of $template_main_menu to either of the two new variables.  You just need to make sure you put them in the correct new variable since Coppermine needs to be able to find certain buttons in the correct menu (otherwise you'll get the dreaded "Template Error").

Puffinstuff

Thanks Paver...

Seems I am 'playing' in the right area as I went into Hardwired and Sample and the button and found the add btton (could not get it to work). 

I will go back in (armed with your advise) and give that a go....

Cheers... back soon with results.

appreciate it......

Puffinstuff

Bingo...

In the array....reset the target to the page you want linked (here I have hijacked the Last Upload button but will recreate appropriately now that it works)

'{LASTUP_TGT}' => "custompage.htm",

Then to have that open up in new window...

(inder the // HTML template for template sub_menu buttons)
addbutton($sub_menu_buttons,'{LASTUP_LNK}','{LASTUP_TITLE}','{LASTUP_TGT}" target="_blank','lastup',$template_sub_menu_spacer);

Many thanks....

Next is to work out how to have that open as a Chromeless window...  (not sure of the code.....any clues??)

Paver

You're welcome.

There's a rule of "one question per thread" so you need to start another thread with your question.  Make sure you search the forum before you post.

Marking this thread as "Solved".