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

Best way to edit pages_menu.tpl and pages.php

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-18-2004, 02:14 AM
  Gijs's Avatar 
Gijs Gijs is offline
 

eXpert
  
Join Date: Aug 2004
Location: Belgium
Posts: 295
 

Default 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
__________________
X-cart 4.1.11
PHP 5 MySQL 5
www.wheelpalace.eu
Reply With Quote
  #2  
Old 10-20-2004, 09:21 PM
  Gijs's Avatar 
Gijs Gijs is offline
 

eXpert
  
Join Date: Aug 2004
Location: Belgium
Posts: 295
 

Default

Hi,

Anybody who could point me to the right direction ?

Thanks,

Gijs
__________________
X-cart 4.1.11
PHP 5 MySQL 5
www.wheelpalace.eu
Reply With Quote
  #3  
Old 10-21-2004, 03:31 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

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
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #4  
Old 10-21-2004, 03:39 AM
  Gijs's Avatar 
Gijs Gijs is offline
 

eXpert
  
Join Date: Aug 2004
Location: Belgium
Posts: 295
 

Default

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
__________________
X-cart 4.1.11
PHP 5 MySQL 5
www.wheelpalace.eu
Reply With Quote
  #5  
Old 10-21-2004, 03:47 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

doh, corrected my post
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #6  
Old 10-21-2004, 04:47 AM
  Stephen Hatton's Avatar 
Stephen Hatton Stephen Hatton is offline
 

Senior Member
  
Join Date: Mar 2004
Location: Melbourne, Australia
Posts: 182
 

Default 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
__________________
Apache Linux V1.3.33
PERL version: 5.8.0
PHP version: 4.3.11
MySQL version: 4.0.22-standard
X-cart V4.0.17: Addons: X-PConfig, X-Giftreg, X-Fancycat, X-AOM
Reply With Quote
  #7  
Old 10-22-2004, 10:32 PM
  Gijs's Avatar 
Gijs Gijs is offline
 

eXpert
  
Join Date: Aug 2004
Location: Belgium
Posts: 295
 

Default

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"}
__________________
X-cart 4.1.11
PHP 5 MySQL 5
www.wheelpalace.eu
Reply With Quote
  #8  
Old 10-23-2004, 02:48 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

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
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #9  
Old 10-23-2004, 06:04 AM
  Gijs's Avatar 
Gijs Gijs is offline
 

eXpert
  
Join Date: Aug 2004
Location: Belgium
Posts: 295
 

Default

thanks shan,

Great tip

Found it:
Code:
{if $store_language eq "NL"}
__________________
X-cart 4.1.11
PHP 5 MySQL 5
www.wheelpalace.eu
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 07:21 PM.

   

 
X-Cart forums © 2001-2020