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 dynamic pages and assigning language variables to them (https://forum.x-cart.com/showthread.php?t=32195)

g053584398 06-29-2007 06:39 PM

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.

carpeperdiem 06-30-2007 04:31 AM

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

g053584398 07-04-2007 05:38 AM

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!


All times are GMT -8. The time now is 12:01 AM.

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