Changing the order of the Menu Changing the order of the Menu
 

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

Changing the order of the Menu

Started by uk_martin, January 03, 2011, 03:38:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

uk_martin

Hi

Is there anything other than the theme.php file which affects the order that items appear in the menu?

What I would like is for the Registration / Login / Logout items to the right of "Search" and I would like the Custom Link to be the one furthest to the left (it will be the one to the site's Portal, with the gallery index next to it)

What i tried to achieve this was to move the following:

<!-- BEGIN register -->
                <li>
                    <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}" class="firstlevel"><span class="firstlevel">{REGISTER_ICO}{REGISTER_LNK}</span></a>
                </li>
<!-- END register -->
<!-- BEGIN login -->
                <li>
                    <a href="{LOGIN_TGT}" title="{LOGIN_LNK}" class="firstlevel"><span class="firstlevel">{LOGIN_ICO}{LOGIN_LNK}</span></a>
                </li>
<!-- END login -->
<!-- BEGIN logout -->
                <li>
                    <a href="{LOGOUT_TGT}" title="{LOGOUT_LNK}" class="firstlevel"><span class="firstlevel">{LOGOUT_ICO}{LOGOUT_LNK}</span></a>
                </li>
<!-- END logout -->


to a postion just after

<!-- BEGIN search -->
                <li>
                    <a href="{SEARCH_TGT}" title="{SEARCH_LNK}" class="firstlevel"><span class="firstlevel">{SEARCH_ICO}{SEARCH_LNK}</span></a>
                </li>
<!-- END search -->


Sadly this didn't work with a page reulting that looked like this (literally):
Template error
Failed to find block 'login' (#<!-- BEGIN login -->(.*?)<!-- END login -->#s) in :

<ul class="dropmenu">
<!-- BEGIN home -->
                <li>
                    <a href="{HOME_TGT}" title="{HOME_TITLE}" class="firstlevel"><span class="firstlevel">{HOME_ICO}{HOME_LNK}</span></a>
                    <ul>
                    <!-- BEGIN contact -->
                                <li>
                                    <a href="{CONTACT_TGT}" title="{CONTACT_TITLE}"><span>{CONTACT_ICO}{CONTACT_LNK}</span></a>
                                </li>
                    <!-- END contact -->
                    <!-- BEGIN sidebar -->
                                    <li>
                                        <a href="{SIDEBAR_TGT}" title="{SIDEBAR_TITLE}"><span>{SIDEBAR_ICO}{SIDEBAR_LNK}</span></a>
                                    </li>
                    <!-- END sidebar -->
                    <!-- BEGIN my_profile -->
                                    <li>
                                        <a href="{MY_PROF_TGT}" title="{MY_PROF_LNK}"><span>{MY_PROF_ICO}{MY_PROF_LNK}</span></a>
                                    </li>
                    <!-- END my_profile -->
                    </ul>
                </li>
<!-- BEGIN allow_memberlist -->
                                    <!--
                                    <li>
                                        <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}"><span>{MEMBERLIST_ICO}{MEMBERLIST_LNK}</span></a>
                                    </li>
                                    -->
<!-- END allow_memberlist -->

<!-- END home -->
<!-- BEGIN my_gallery -->
                <li>
                    <a href="{MY_GAL_TGT}" title="{MY_GAL_TITLE}" class="firstlevel"><span class="firstlevel">{MY_GAL_ICO}{MY_GAL_LNK}</span></a>
                    <ul>
                    <!-- BEGIN allow_memberlist -->
                                    <li>
                                        <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}"><span>{MEMBERLIST_ICO}{MEMBERLIST_LNK}</span></a>
                                    </li>
                    <!-- END allow_memberlist -->
                    <!-- BEGIN enter_admin_mode -->
                                    <li>
                                    <a href="{ADM_MODE_TGT}" title="{ADM_MODE_TITLE}"><span>{ADM_MODE_ICO}{ADM_MODE_LNK}</span></a>
                                    </li>
                    <!-- END enter_admin_mode -->
                    <!-- BEGIN leave_admin_mode -->
                                    <li>
                                        <a href="{USR_MODE_TGT}" title="{USR_MODE_TITLE}"><span>{USR_MODE_ICO}{USR_MODE_LNK}</span></a>
                                    </li>
                    <!-- END leave_admin_mode -->
                    </ul>
                </li>
<!-- END my_gallery -->
<!-- BEGIN upload_pic -->
                <li>
                    <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}" class="firstlevel"><span class="firstlevel">{UPL_PIC_ICO}{UPL_PIC_LNK}</span></a>
                </li>
<!-- END upload_pic -->

</ul>


There seem to be two <ul class="dropmenu"> lists, one starting with <!-- BEGIN home --> and the second beginning with <!-- BEGIN custom_link -->

Somehow the page seems to be expecting the Registration / Login / Logout to be in the first list and when I move it to the second list, it does not find it. Presumably the same problem will arise in reverse with the Custom Menu item?

What is it that is looking for these items in these lists and how can I edit the files to make the menu appear in the order that I want?

Thanks

Martin

ΑndrĂ©

In Coppermine there's a sys_menu and a sub_menu. You cannot exchange buttons between those menus but only move the order inside that menus. Of course you can change the order of the sys_menu and the sub_menu, but that's not exactly what you asked for.

However, if you want to display buttons from the sub_menu inside the sys_menu (or vice-versa) you can remove them from the menu, but you have to leave the HTML comments where they are. Keep in mind that moving a menu button to the other menu will always be displayed until you change the code to remove them (e.g. if the user don't have the permission to see that button).

uk_martin

hmmm, I guess that's an end to that then.

I did see on another help thread something about a second custom menu item being able to be "hard coded" into the menu, so I've done that instead for the link to the portal. I'll have to live with the login (etc) being where it is by the sounds of it then.

Thanks anyway.

Martin