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)
-   -   Best way to edit pages_menu.tpl and pages.php (https://forum.x-cart.com/showthread.php?t=9890)

Gijs 10-18-2004 02:14 AM

Best way to edit pages_menu.tpl and pages.php
 
Hi,

I have 5 different static pages. But I only want to list 4 of them throughout the pages_menu.tpl.
The fifth one I only want to accessible through a hyperlink like: pages.php?pageid=5
As I use different languages that page 5 will probably have a different pageid in the different languages.

So whats the best way to tackle this ?
Change pages.php and create an extra extra php-file for extracting only page 5 (this I know how to do)
OR
Change pages_menu.tpl (this I dont know how tod do) so that it doesn't list page 5 and create an extra template for page 5 only.

Some advise and help would be much appreciated.
Thanks in advance,

Gijs

Gijs 10-20-2004 09:21 PM

Hi,

Anybody who could point me to the right direction ?

Thanks,

Gijs

shan 10-21-2004 03:31 AM

wrap edit pages_menu.tpl as follows... (4.0.5 code)


Code:


{* $Id: pages_menu.tpl,v 1.4 2004/06/24 09:53:29 max Exp $ *}
{section name=pg loop=$pages_menu}

{if $pages_menu[pg].pageid ne "5"}

{$pages_menu[pg].title}


{/if}
{/section}



then add your link to page 5 where ever you need to

Gijs 10-21-2004 03:39 AM

Hi shan,

Thanks very much ! I'll give it a try.

Correct me if I'm wrong, but through smarty-templates you can ad conditional statements (WHERE clauses) in stead of perfoming it them php.

Best regards,

Gijs

shan 10-21-2004 03:47 AM

doh, corrected my post

Stephen Hatton 10-21-2004 04:47 AM

Pages inside X-cart menu and layout structure
 
Hi all

As a newbie, I found a different solution to this problem of displaying special pages inside the x-cart frame work and not appearing on the menu listing.

I have normal Pages listed on the menu, Hidden pages not shown on the menu but you can call up via links to these pages, and Test pages that you can view but are not available to the public until you enable them (eg. xmas specials). All the pages can be edited through Admin or you can edit the HTML file directly /yoursite/skin1/pages/US.

If you are interested, I will send you the files. They are a bit long to list here.

The mods are to V4.0.5 but you can make them work on any version.

Regards
Stephen Hatton

email: stephen_hatton1959@yahoo.com.au

Gijs 10-22-2004 10:32 PM

Hi Shan,

Code works fine.

As a use different languages i have work around the fact that the pageid in the pages table is auto_increment.

Found a solution:
Code:

{* $Id: pages_menu.tpl,v 1.4 2004/06/24 09:53:29 max Exp $ *}

{if $lng.lbl_select_language eq "Selecteer taal"}
{section name=pg loop=$pages_menu}
{if $pages_menu[pg].pageid ne "1"}

{$pages_menu[pg].title}
 

{/if}
{/section}

{elseif $lng.lbl_select_language eq "Select language"}
{section name=pg loop=$pages_menu}
{if $pages_menu[pg].pageid ne "5"}

{$pages_menu[pg].title}
 

{/if}
{/section}

{/if}


I use the $lng.lbl_select as a criterium. I'm not happy with that at all. I would prefer to use language-values like US and NL.

Question: is there a $variable language that could be called ?
This way i could use {if $language eq "US"}

shan 10-23-2004 02:48 AM

should be

edit xcart/smarty.php

find

Code:

$smarty->debug_tpl="file:debug_templates.tpl";

change to

Code:

$smarty->debug_tpl="file:debug.tpl";

now you see a better list of vars when u use the debug window

Gijs 10-23-2004 06:04 AM

thanks shan,

Great tip :!:

Found it:
Code:

{if $store_language eq "NL"}


All times are GMT -8. The time now is 09:52 AM.

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