Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Creating new Menu for Static Pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-12-2006, 03:48 AM
 
soyuz02 soyuz02 is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 71
 

Default 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.
__________________
X-Cart Version :: 4.1.6 (Finally)
X-Cart Mods :: Kids Skin by 7dana
Running on :: SUSE Linux 9.3 with Plesk 7.5.4
Webserv :: Apache 2.0.53
mySQL :: 4.1.10
PHP :: 4.3.10
Reply With Quote
  #2  
Old 08-12-2006, 04:18 AM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default

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 }
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
  #3  
Old 08-12-2006, 04:55 AM
 
soyuz02 soyuz02 is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 71
 

Default

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
__________________
X-Cart Version :: 4.1.6 (Finally)
X-Cart Mods :: Kids Skin by 7dana
Running on :: SUSE Linux 9.3 with Plesk 7.5.4
Webserv :: Apache 2.0.53
mySQL :: 4.1.10
PHP :: 4.3.10
Reply With Quote
  #4  
Old 08-12-2006, 05:10 AM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default

Works 100% correctly, just tested on your site.

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?
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
  #5  
Old 08-12-2006, 05:16 AM
 
soyuz02 soyuz02 is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 71
 

Default

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
__________________
X-Cart Version :: 4.1.6 (Finally)
X-Cart Mods :: Kids Skin by 7dana
Running on :: SUSE Linux 9.3 with Plesk 7.5.4
Webserv :: Apache 2.0.53
mySQL :: 4.1.10
PHP :: 4.3.10
Reply With Quote
  #6  
Old 08-12-2006, 05:21 AM
 
soyuz02 soyuz02 is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 71
 

Default

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
__________________
X-Cart Version :: 4.1.6 (Finally)
X-Cart Mods :: Kids Skin by 7dana
Running on :: SUSE Linux 9.3 with Plesk 7.5.4
Webserv :: Apache 2.0.53
mySQL :: 4.1.10
PHP :: 4.3.10
Reply With Quote
  #7  
Old 08-12-2006, 05:21 AM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default

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.
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
  #8  
Old 08-12-2006, 05:38 AM
 
soyuz02 soyuz02 is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 71
 

Default

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]
__________________
X-Cart Version :: 4.1.6 (Finally)
X-Cart Mods :: Kids Skin by 7dana
Running on :: SUSE Linux 9.3 with Plesk 7.5.4
Webserv :: Apache 2.0.53
mySQL :: 4.1.10
PHP :: 4.3.10
Reply With Quote
  #9  
Old 08-12-2006, 05:47 AM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default

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.
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
  #10  
Old 08-12-2006, 05:56 AM
 
soyuz02 soyuz02 is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 71
 

Default

Did everything you said and same thing keeps happening. Weird....
__________________
X-Cart Version :: 4.1.6 (Finally)
X-Cart Mods :: Kids Skin by 7dana
Running on :: SUSE Linux 9.3 with Plesk 7.5.4
Webserv :: Apache 2.0.53
mySQL :: 4.1.10
PHP :: 4.3.10
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:52 PM.

   

 
X-Cart forums © 2001-2020