Create a new tab on the main menu on my jamroom site

alt=
@kayskeem
11 years ago
200 posts
Hi,
I followed your marvelous tutorial on creating a new page for a skin http://www.jamroom.net/the-jamroom-network/documentation/development/1043/creating-a-new-page-for-a-skin but the problem is i tried to put that on the menu and i couldnt figure it out. What i did was change the code of an existing page in the skin and now the url is still reading the old page i edited. Its just a big mess as you can see the url here http://exposehits.com/galleries doesnt match the actual menu name. My question however is how do you make that same new page you created (as shown in that tutorial video) to show at the top menus on the homepage ? Any help will be greatly appreciated !
updated by @kayskeem: 01/07/14 03:12:03AM
michael
@michael
11 years ago
7,717 posts
The easiest way is to go into the menu.tpl file in your skin
/skins/jrProJamLight/menu.tpl

and add another entry to the list like this.

This is what it will look like now:
{foreach from=$_items name="loop" item="entry"}
    {assign var="oc" value=""}
    {if isset($entry.menu_onclick)}
        {assign var="oc" value=" onclick=\"`$entry.menu_onclick`"}
    {/if}
    {if isset($entry.menu_function_result) && strlen($entry.menu_function_result) > 0}
        {if is_numeric($entry.menu_function_result)}
        <li><a href="{$entry.menu_url}">{$entry.menu_label} [{$entry.menu_function_result}]</a></li>
            {else}
        <li><a href="{$entry.menu_url}">{$entry.menu_label} <img src="{$entry.menu_function_result}" alt="{$entry.menu_label}"></a></li>
        {/if}
        {else}
    <li><a href="{$entry.menu_url}">{$entry.menu_label}</a></li>
    {/if}
{/foreach}

so add this at the bottom after that last {/foreach}
<li><a href="{$jamroom_url}/galleries">galleries</a></li>

Then reset the caches and it should be good to go.

--edit--
Just to be clear, the full code would look like this now:
{foreach from=$_items name="loop" item="entry"}
    {assign var="oc" value=""}
    {if isset($entry.menu_onclick)}
        {assign var="oc" value=" onclick=\"`$entry.menu_onclick`"}
    {/if}
    {if isset($entry.menu_function_result) && strlen($entry.menu_function_result) > 0}
        {if is_numeric($entry.menu_function_result)}
        <li><a href="{$entry.menu_url}">{$entry.menu_label} [{$entry.menu_function_result}]</a></li>
            {else}
        <li><a href="{$entry.menu_url}">{$entry.menu_label} <img src="{$entry.menu_function_result}" alt="{$entry.menu_label}"></a></li>
        {/if}
        {else}
    <li><a href="{$entry.menu_url}">{$entry.menu_label}</a></li>
    {/if}
{/foreach}
<li><a href="{$jamroom_url}/galleries">galleries</a></li>

updated by @michael: 12/02/13 06:37:13PM
alt=
@kayskeem
11 years ago
200 posts
Thanks for the help. I tried this way and the page i created goes to the user's menu. The menu I was talking about is the website homepage menu where it says "home" "music" "galleries" "Gigs"etc i'm using the projam light template. I'd like it right before galleries" or after.
michael
@michael
11 years ago
7,717 posts
ah sorry.

Try this, galleries is line 163 ish of jrProjamLight/header.tpl

The galleries item looks like this:
<li><a href="{$jamroom_url}/galleries"{if isset($selected) && $selected == 'galleries'} style="background-color: {$active_color};color:#000;"{/if}>{jrCore_lang skin=$_conf.jrCore_active_skin id="29" default="galleries"}</a></li>

Put your 'li' on either side of that.
alt=
@kayskeem
11 years ago
200 posts
it worked ! Thanks.

Tags