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)
-   -   controlling static page appearance (https://forum.x-cart.com/showthread.php?t=43925)

tbm 11-28-2008 02:20 AM

controlling static page appearance
 
Hello,

Is it possible to have static pages appear in the help menu and one of the other menus?

Thanks,

tbm

Yurij 11-28-2008 03:47 AM

Re: controlling static page appearance
 
Quote:

Originally Posted by tbm
Hello,

Is it possible to have static pages appear in the help menu and one of the other menus?

Thanks,

tbm


You can use the solution snippet for the division into blocs.
block 1 (all static page with value 'order by' <=100)
PHP Code:

{section name=pg loop=$pages_menu}
{if 
$pages_menu[pg].orderby lte 100}
<
a href="pages.php?pageid={$pages_menu[pg].pageid}class="VertMenuItems">{$pages_menu[pg].title}</a><br />
{/if}
{/
section


block 2 (all static page with value 'order by' >100)
PHP Code:

{section name=pg loop=$pages_menu}
{if 
$pages_menu[pg].orderby gt 100}
<
a href="pages.php?pageid={$pages_menu[pg].pageid}class="VertMenuItems">{$pages_menu[pg].title}</a><br />
{/if}
{/
section


tbm 12-03-2008 06:28 AM

Re: controlling static page appearance
 
Hi Yurij,

That makes sense, and is exactly what I'm after. Which PHP code do I apply it too though?

Thanks,

Mark.

Yurij 12-04-2008 12:18 AM

Re: controlling static page appearance
 
You do not need to change "PHP" code.

Just add these blocks to the template and add the static pages (for "orderby" <100 and "orderby"> 100)

tbm 12-10-2008 07:45 AM

Re: controlling static page appearance
 
Hi Yuri,

I added this code to the pages_menu.tpl, see bellow:

Code:

{* $Id: pages_menu.tpl,v 1.5 2005/11/17 06:55:36 max Exp $ *}
{*{section name=pg loop=$pages_menu}
<a href="pages.php?pageid={$pages_menu[pg].pageid}" class="VertMenuItems">{$pages_menu[pg].title}</a><br />
{/section}*}

{section name=pg loop=$pages_menu}
{if $pages_menu[pg].orderby lte 100}
<a href="pages.php?pageid={$pages_menu[pg].pageid}" class="VertMenuItems">{$pages_menu[pg].title}</a><br />
{/if}
{/section} 

{section name=pg loop=$pages_menu}
{if $pages_menu[pg].orderby gt 100}
<a href="pages.php?pageid={$pages_menu[pg].pageid}" class="VertMenuItems">{$pages_menu[pg].title}</a><br />
{/if}
{/section}


does that look right? it doesn't seem to be working. do i not need to refer to the menu modules that i need the static pages to appear in?

Yurij 12-10-2008 08:05 AM

Re: controlling static page appearance
 
Quote:

Originally Posted by tbm
Hi Yuri,

I added this code to the pages_menu.tpl, see bellow:

Code:

{* $Id: pages_menu.tpl,v 1.5 2005/11/17 06:55:36 max Exp $ *}
{*{section name=pg loop=$pages_menu}
<a href="pages.php?pageid={$pages_menu[pg].pageid}" class="VertMenuItems">{$pages_menu[pg].title}</a><br />
{/section}*}

{section name=pg loop=$pages_menu}
{if $pages_menu[pg].orderby lte 100}
<a href="pages.php?pageid={$pages_menu[pg].pageid}" class="VertMenuItems">{$pages_menu[pg].title}</a><br />
{/if}
{/section} 

{section name=pg loop=$pages_menu}
{if $pages_menu[pg].orderby gt 100}
<a href="pages.php?pageid={$pages_menu[pg].pageid}" class="VertMenuItems">{$pages_menu[pg].title}</a><br />
{/if}
{/section}


does that look right? it doesn't seem to be working. do i not need to refer to the menu modules that i need the static pages to appear in?



Ok...

try added next code to the "help.tpl" (used it just for examples):

PHP Code:

{* $Idhelp.tpl,v 1.20 2005/11/17 06:55:36 max Exp $ *}
{
capture name=menu}
<
a href="help.php?section=contactus&amp;mode=update" class="VertMenuItems">{$lng.lbl_contact_us}</a><br />
<
a href="help.php?section=business" class="VertMenuItems">{$lng.lbl_privacy_statement}</a><br />
<
a href="help.php?section=conditions" class="VertMenuItems">{$lng.lbl_terms_n_conditions}</a><br />
{*
{include 
file="pages_menu.tpl"}
*}
{/
capture}
{ include 
file="menu.tpl" dingbats="dingbats_help.gif" menu_title=$lng.lbl_help menu_content=$smarty.capture.menu link_href="help.php"}


<
br />
{
capture name=menu}
    {
section name=pg loop=$pages_menu}
        {if 
$pages_menu[pg].orderby lte 100}
            <
a href="pages.php?pageid={$pages_menu[pg].pageid}class="VertMenuItems">{$pages_menu[pg].title}</a><br />
        {/if}
    {/
section}  
{/
capture}
{include 
file="menu.tpl"  menu_title="Block 1" menu_content=$smarty.capture.menu}
<
br />

{
capture name=menu}
    {
section name=pg loop=$pages_menu}
        {if 
$pages_menu[pg].orderby gt 100}
            <
a href="pages.php?pageid={$pages_menu[pg].pageid}class="VertMenuItems">{$pages_menu[pg].title}</a><br />
        {/if}
    {/
section
{/
capture}
{include 
file="menu.tpl"  menu_title="Block 2" menu_content=$smarty.capture.menu


PS. And add a some pages with the "order by" more than 100.

PS2. If there are more questions, ask me ;)

tbm 12-10-2008 08:38 AM

Re: controlling static page appearance
 
Ok, that worked! it created 2 new menu blocks and put the correct menu items in each!

now, if i want to add certain static pages to the manufacturers menu and other static pages to the help can i do this using the same idea?

for example, if i wanted to add the < 100 static menu items to the help menu, could i do this:

PHP Code:

{* $Idhelp.tpl,v 1.20 2005/11/17 06:55:36 max Exp $ *}
{
capture name=menu}
<
a href="help.php?section=contactus&amp;mode=update" class="VertMenuItems">{$lng.lbl_contact_us}</a><br />
<
a href="help.php?section=business" class="VertMenuItems">{$lng.lbl_privacy_statement}</a><br />
<
a href="help.php?section=conditions" class="VertMenuItems">{$lng.lbl_terms_n_conditions}</a><br />

{
section name=pg loop=$pages_menu}
        {if 
$pages_menu[pg].orderby lte 100}
            <
a href="pages.php?pageid={$pages_menu[pg].pageid}class="VertMenuItems">{$pages_menu[pg].title}</a><br />
        {/if}
    {/
section}  

{/
capture}
{ include 
file="menu.tpl" dingbats="dingbats_help.gif" menu_title=$lng.lbl_help menu_content=$smarty.capture.menu link_href="help.php"


Yurij 12-11-2008 01:05 AM

Re: controlling static page appearance
 
Quote:

Originally Posted by tbm
Ok, that worked! it created 2 new menu blocks and put the correct menu items in each!

now, if i want to add certain static pages to the manufacturers menu and other static pages to the help can i do this using the same idea?

for example, if i wanted to add the < 100 static menu items to the help menu, could i do this:

PHP Code:

{* $Idhelp.tpl,v 1.20 2005/11/17 06:55:36 max Exp $ *}
{
capture name=menu}
<
a href="help.php?section=contactus&amp;mode=update" class="VertMenuItems">{$lng.lbl_contact_us}</a><br />
<
a href="help.php?section=business" class="VertMenuItems">{$lng.lbl_privacy_statement}</a><br />
<
a href="help.php?section=conditions" class="VertMenuItems">{$lng.lbl_terms_n_conditions}</a><br />

{
section name=pg loop=$pages_menu}
        {if 
$pages_menu[pg].orderby lte 100}
            <
a href="pages.php?pageid={$pages_menu[pg].pageid}class="VertMenuItems">{$pages_menu[pg].title}</a><br />
        {/if}
    {/
section}  

{/
capture}
{ include 
file="menu.tpl" dingbats="dingbats_help.gif" menu_title=$lng.lbl_help menu_content=$smarty.capture.menu link_href="help.php"




Yes, you can (Use composite conditions), example for "120 >= orderby > 100":

PHP Code:

{section name=pg loop=$pages_menu}
        {if 
$pages_menu[pg].orderby gt 100 and $pages_menu[pg].orderby lte 120}
            <
a href="pages.php?pageid={$pages_menu[pg].pageid}class="VertMenuItems">{$pages_menu[pg].title}</a><br />
        {/if}
{/
section


tbm 12-11-2008 01:17 AM

Re: controlling static page appearance
 
that worked! thanks yurij!

now, can i apply the same principle to the product or manufacturer menus? having a look at their relevant .tpl files, it's not as obvious where to put the code.

Yurij 12-11-2008 01:32 AM

Re: controlling static page appearance
 
Quote:

Originally Posted by tbm
that worked! thanks yurij!

now, can i apply the same principle to the product or manufacturer menus? having a look at their relevant .tpl files, it's not as obvious where to put the code.



You can split into as many blocks - how much you need.

Left manufacturer menu block - "skin1\modules\Manufacturers\menu_manufacturers.tp l ".


All times are GMT -8. The time now is 02:44 PM.

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