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

Creating dynamic pages and assigning language variables to them

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-29-2007, 06:39 PM
 
g053584398 g053584398 is offline
 

Newbie
  
Join Date: Jun 2006
Posts: 9
 

Default Creating dynamic pages and assigning language variables to them

Using: X-Cart Gold 4.1.6

This is my first post, so please be gentle with me!

I've created a custom 'Content' menu that is displayed above the 'Products' menu, and have hard coded the links into the template. All works fine, but some of the links are to pages created with the Static Pages area of the admin. The problem is that the same static pages also show up in the 'Help' menu as well, and I only want certain pages to show up under the 'Content' menu, not the 'Help' menu.

One way around the problem is to remove a line of code from the template which controls the 'Help' menu, which then means that only the Privacy Statement and Terms & Conditions links appear. That would be fine, but would then mean that if I decide to add more static pages in the future they will me missing from the 'Help' menu navigation.

Basically I'd like some advice on how to achieve the following:

I thought that the way around the problem would be to create custom pages for each of the currently static pages that I'd like to appear under the 'Contents' menu and assign language variables to them so that they could be edited simply. The problem is I don't seem to be able to do this!

Does anyone have any suggestions please? All help will be greatly appreciated.
__________________
D.G.

X-Cart Gold 4.1.6
Reply With Quote
  #2  
Old 06-30-2007, 04:31 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Creating dynamic pages and assigning language variables to them

D.G. -- welcme to xcart.

before you do anything else, please update your forum signature with your exact version (although your forum post says gold 4.1.6, please put it into your sig).

http://forum.x-cart.com/profile.php?do=editsignature

To answer your question, you may want to try this:

Make static embedded pages (well documented in the docs) -- you can either hard-code these pages, or use smarty variables...

To break the pages out into their own menu,

1. in pages_menu.tpl

AFTER:
Code:
{section name=pg loop=$pages_menu}

INSERT:
Code:
{if $pages_menu[pg].orderby > 900} {else} before:
YOUR NORMAL CODE FOR PAGES MENU don't forget to add the closing: {/if} before {/section}

2. Then, in your static pages admin setup, assign the POS greater than 900 to pages that you don't want in the "loop" that gets included in the menu.

3. To determine the URL of the static page, hover over the link in the admin and look at the status bar of your browser.

4. Hard code the link of the "hidden" URL (those w/ POS greater than 900) where you need it.

I use the > 900 technique for private pages and logout confirmations and all kinds of little tricks...

You can always "hard code" the link to the "new" static embedded pages... for the "new" menu... I hope this makes sense. Good luck.

jeremy
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #3  
Old 07-04-2007, 05:38 AM
 
g053584398 g053584398 is offline
 

Newbie
  
Join Date: Jun 2006
Posts: 9
 

Smile Re: Creating dynamic pages and assigning language variables to them

Hi Jeremy,

Many thanks for your assistance, which is really appreciated. I haven't tried the workaround yet, but it all makes perfect sense and seems a very clever way of dealing with the issue.

Once I've implemented the new code I'll give you a progress report.

Thanks again!
__________________
D.G.

X-Cart Gold 4.1.6
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 11:10 AM.

   

 
X-Cart forums © 2001-2020