X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Creating new Menu for Static Pages (https://forum.x-cart.com/showthread.php?t=24054)

soyuz02 08-12-2006 03:48 AM

Creating new Menu for Static Pages
 
Hi,

I wanted to create a new menu to display the links to all the static pages I create instead of having them under "Help". I followed the intructions below and it worked just fine.

Quote:

Originally Posted by NightFire
In the skin1 folder look for the help.tpl file.
Inside that file look for this line:

Code:

{include file="pages_menu.tpl"}

Change it to:
Code:

{*{include file="pages_menu.tpl"}*}
This will prevent the static pages showing up in the help section.

To create a menu with only the static pages links:
In the skin1 directory create a new file called for example: new_menu.tpl

And place this code in it:

Code:

{capture name=menu}
{include file="pages_menu.tpl"}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_help.gif" menu_title=$lng.lbl_help menu_content=$smarty.capture.menu}


You can adjust the menu to your liking by changing the lbl_help variable.

In skin1/customer/home.tpl insert this code where you want to include the menu:

Code:

{include file="new_menu.tpl" }

This should do the trick


However I do have one small issue. I have integrated the menu so that it comes up on the left side below the categories menu. Is does this fine however the formatting was slightly different. I wanted to assign the same css class as the categories menu. Hence in the pages menu I added div tags to make it look like this:

Code:

{* $Id: pages_menu.tpl,v 1.5 2005/11/17 06:55:36 max Exp $ *}
{section name=pg loop=$pages_menu}
<div class="categories">
{$pages_menu[pg].title}
</div>
{/section}


It works but it shifts the new links slightly inwards and not flush against the left side like in the categories menu. Looks like this:

http://www.bccbdubai.com/problem2.jpg

Any ideas how I can make it look like under the categories menu?

Would be a great help. Thanks.

Zaja 08-12-2006 04:18 AM

Use following code for new_menu.tpl:
Code:

{* $Id: pages_menu.tpl,v 1.5 2005/11/17 06:55:36 max Exp $ *}
<div class="categories">
{section name=pg loop=$pages_menu} 
&raquo;{$pages_menu[pg].title} 
{/section}
</div>
{ include file="menu_cat.tpl" menu_title="Sell Books" menu_content=$smarty.capture.menu }


soyuz02 08-12-2006 04:55 AM

It works for the formatting but now that menu no longer displays the links to the static pages. Clicking the link now simply does the same thing as when I click the first link of the categories menu. And the statics page links are displayed in the categories menu.

http://www.bccbdubai.com/problem3.jpg

Help?

Its your kids template im using :D

Zaja 08-12-2006 05:10 AM

Works 100% correctly, just tested on your site. :wink:

Sell Books menu link is linked to Sell Books page with "Page1 content" text as content.

EDITED: Now you have moved static page link to Categories box?

soyuz02 08-12-2006 05:16 AM

This is how i see it:

http://www.bccbdubai.com/problem3.jpg

The sell Books link should appear under the sell books menu. And the sell books menu should not contain another categories link (Textbooks)

?
Thanks

soyuz02 08-12-2006 05:21 AM

I didnt move anything, this is how it showed to me right from when I made the change you suggested. I now created a new static page and its also showing up under the category menu. Help? Thanks

Zaja 08-12-2006 05:21 AM

I checked 10 minutes before and pages menu worked fine. Now you have moved static page link to Categories box? Why?
It's very simple, don't touch categories menu, just create new menu for static pages with following code, tested and work 110%:
Code:

{* $Id: pages_menu.tpl,v 1.5 2005/11/17 06:55:36 max Exp $ *}
{capture name=menu}
<div class="categories">
{section name=pg loop=$pages_menu}
&raquo;{$pages_menu[pg].title}
{/section}
</div>
{/capture}
{ include file="menu_cat.tpl" menu_title="Sell Books" menu_content=$smarty.capture.menu }


Or send me ftp info to support@7dana.com and I will make this for you.

soyuz02 08-12-2006 05:38 AM

Seriously, it doesnt work, it keeps on doing the same thing although i didnt touch the other menus. I think 10 mins ago you got confused cause I had a second category called Sell Books which I deleted afterwards, thats maybe why you saw it displaying.

Heres my categories.tpl

Code:

{* $Id: categories.tpl,v 1.26 2005/11/17 06:55:37 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="modules/Fancy_Categories/categories.tpl"}
{assign var="fc_cellpadding" value="0"}
{else}
{if $config.General.root_categories eq "Y"}
<div class="categories">
{foreach from=$categories item=c}
&raquo;{$c.category}
{/foreach}
</div>
{else}
<div class="categories">
{foreach from=$subcategories item=c key=catid}
&raquo;{$c.category}
{/foreach}
</div>
{/if}
{/if}
{/capture}
{ include file="menu_cat.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}


Heres my customer/home.tpl

Code:

{* $Id: home.tpl,v 1.88.2.2 2006/06/30 10:09:49 max Exp $ *}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{if $printable ne ''}
{include file="customer/home_printable.tpl"}
{else}
{config_load file="$skin_config"}
<html>
<head>
<title>
{if $config.SEO.page_title_format eq "A"}
{section name=position loop=$location}
{$location[position].0|strip_tags|escape}
{if not %position.last%} :: {/if}
{/section}
{else}
{section name=position loop=$location step=-1}
{$location[position].0|strip_tags|escape}
{if not %position.last%} :: {/if}
{/section}
{/if}
</title>
{include file="meta.tpl" }
<link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}" />
</head>
<body{$reading_direction_tag}{if $body_onload ne ''} onload="javascript: {$body_onload}"{/if}>
{include file="rectangle_top.tpl" }
{include file="head.tpl" }
{if $active_modules.SnS_connector}
{include file="modules/SnS_connector/header.tpl"}
{/if}

<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="VertMenuLeftColumn">
{if $categories ne "" and ($active_modules.Fancy_Categories ne "" or $config.General.root_categories eq "Y" or $subcategories ne "")}
{include file="customer/categories.tpl" }
{/if}
{include file="sell_menu.tpl" }
{if $active_modules.SnS_connector && $config.SnS_connector.sns_display_button eq 'Y' && $sns_collector_path_url ne ''}
{include file="modules/SnS_connector/button.tpl"}
{/if}
{if $active_modules.Feature_Comparison ne "" && $comparison_products ne ''}
{include file="modules/Feature_Comparison/product_list.tpl" }
{/if}
{include file="customer/menu_cart.tpl" }
{if $login eq "" }
{include file="auth.tpl" }
{else}
{include file="authbox.tpl" }
{/if}
{include file="customer/special.tpl"}
{if $active_modules.Bestsellers ne "" and $config.Bestsellers.bestsellers_menu eq "Y"}
{include file="modules/Bestsellers/menu_bestsellers.tpl" }
{/if}
{include file="news.tpl" }
{if $active_modules.XAffiliate ne ""}
{include file="partner/menu_affiliate.tpl" }
{/if}
{if $active_modules.Interneka ne ""}
{include file="modules/Interneka/menu_interneka.tpl" }
{/if}
{if $active_modules.Manufacturers ne "" and $config.Manufacturers.manufacturers_menu eq "Y"}
{include file="modules/Manufacturers/menu_manufacturers.tpl" }
{/if}
{include file="help.tpl" }
{if $active_modules.Surveys && $menu_surveys}
{foreach from=$menu_surveys item=menu_survey}
{include file="modules/Surveys/menu_survey.tpl"}


{/foreach}
{/if}


[img]{$ImagesDir}/spacer.gif[/img]
</td>
<td class="mainLeft">[img]{$ImagesDir}/left_col_angle.gif[/img]</td>
<td width="100%" valign="top" class="main">



{include file="dialog_message.tpl"}
{if $active_modules.Special_Offers ne ""}
{include file="modules/Special_Offers/customer/new_offers_message.tpl"}
{/if}
{include file="customer/home_main.tpl"}



</td>
<td class="main">[img]{$ImagesDir}/spacer.gif[/img]</td>
</tr>
</table>
{include file="rectangle_bottom.tpl" }
</body>
</html>
{/if}


Heres my sell_menu.tpl

Only thing ive changed is to localise label

Code:

{* $Id: pages_menu.tpl,v 1.5 2005/11/17 06:55:36 max Exp $ *}
<div class="categories">
{section name=pg loop=$pages_menu} 
&raquo;{$pages_menu[pg].title} 
{/section}
</div>
{ include file="menu_cat.tpl" menu_title=$lng.lbl.sell_menu menu_content=$smarty.capture.menu }

[/code]

Zaja 08-12-2006 05:47 AM

1. Create empty text file named new_menu.tpl in skin/customer/ and copy following code inside:
Code:

{* $Id: pages_menu.tpl,v 1.5 2005/11/17 06:55:36 max Exp $ *}
{capture name=menu}
<div class="categories">
{include file="pages_menu.tpl"}
</div>
{/capture}
{ include file="menu_cat.tpl" menu_title="Sell Books" menu_content=$smarty.capture.menu }

2. Open skin/customer/home.tpl and add this code under left column:
Code:

{include file="customer/new_menu.tpl" }
3. Clean var/templates_c directory.

soyuz02 08-12-2006 05:56 AM

Did everything you said and same thing keeps happening. Weird....

Zaja 08-12-2006 05:59 AM

Sorry, my mistake, I forget capture menu code, use this code:

Code:

{* $Id: pages_menu.tpl,v 1.5 2005/11/17 06:55:36 max Exp $ *}
{capture name=menu}
<div class="categories">
{section name=pg loop=$pages_menu}
&raquo;{$pages_menu[pg].title}
{/section}
</div>
{/capture}
{ include file="menu.tpl" menu_title="Sell Books" menu_content=$smarty.capture.menu }


soyuz02 08-12-2006 06:12 AM

Got it thanks.

Very greatful for your effort!

soyuz02 09-13-2006 07:54 AM

Re: Creating new Menu for Static Pages
 
I cant get the menu to show up any more in 4.1.3. Any ideas whats wrong?

sunset 10-29-2007 05:09 AM

Re: Creating new Menu for Static Pages
 
Hi there

I have followed the exact instructions in the first part of this thread. So that was a success creating the first help menu in the left hand vertical menu on my site.

However, I cant for the life of me, change the first help label. I want a new menu title for the block of links called FAQ, Links & Colour Chart, but just cant seem to get it right. Can anyone shed some light: My store below is:
http://www.sunsetcrystals.com.au/home.php?shopkey=1234

Hoping someone can shed some light.

Thanks

chamberinternet 10-29-2007 07:43 AM

Re: Creating new Menu for Static Pages
 
That should be a language variable called 'lbl_help'.

But i'd suggest you create a new variable as i'm guessing lbl_help is probably used in other areas of the XC site as well as the administration area.

sunset 10-29-2007 03:16 PM

Re: Creating new Menu for Static Pages
 
Thanks for your reply chamberinternet.....i have now changed it and it works great.

sunset 10-29-2007 03:18 PM

Re: Creating new Menu for Static Pages
 
Just another question, if i only want one of the static page links to go in the new menu, and leave the rest in the help menu, what coding do i use to do that?

chamberinternet 10-30-2007 01:09 AM

Re: Creating new Menu for Static Pages
 
These two posts should answer your query:

http://forum.x-cart.com/viewtopic.php?t=30112
&
http://forum.x-cart.com/showthread.php?t=24113

sunset 10-30-2007 02:21 AM

Re: Creating new Menu for Static Pages
 
Brilliant chamberinternet...really appreciate your help.

vivienne 11-06-2007 02:24 AM

Re: Creating new Menu for Static Pages
 
I copied the code from Zaja but had to change the menu_cat.tpl to menu.tpl for it to work in my 4.1.8 - not sure if that is a right thing to do but it seems to have worked.

{* $Id: pages_menu.tpl,v 1.5 2005/11/17 06:55:36 max Exp $ *}
{capture name=menu}
<div class="categories">
{section name=pg loop=$pages_menu}
&raquo;{$pages_menu[pg].title}
{/section}
</div>
{/capture}
{ include file="menu_cat.tpl" menu_title="Sell Books" menu_content=$smarty.capture.menu }

imclaudiah 11-20-2007 06:22 AM

Re: Creating new Menu for Static Pages
 
Ok, I too got the script to work and put the static pages under a newly created section. My question is: How do you rename the new section? When I created it following the code from Nightfire I get two sections called Help.

Thanks for helping me :-)

hughgjohnson 12-22-2008 02:05 PM

Re: Creating new Menu for Static Pages
 
I too could ue a little help here. I've got it up and working, but don't know how to create a dynamically called link. please see the OTHER:Tours example in the left nav here:

http://www.southamericansecrets.com/store/home.php

My new_menu.tpl:
{* $Id: pages_menu.tpl,v 1.5 2005/11/17 06:55:36 max Exp $ *}
{capture name=menu}
<a class=VertMenuItems href="{$pages_menu[pg].title}" class="block">
{section name=pg loop=$pages_menu}
&raquo;{$pages_menu[pg].title}
{/section}
</a>
{/capture}
{ include file="menu.tpl" menu_title="Other" menu_content=$smarty.capture.menu }


Thanks for any help!


All times are GMT -8. The time now is 12:33 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.