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

controlling static page appearance

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-28-2008, 02:20 AM
 
tbm tbm is offline
 

Advanced Member
  
Join Date: Nov 2008
Posts: 39
 

Default 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
__________________
Linux
X-Cart 4.1.11
Reply With Quote
  #2  
Old 11-28-2008, 03:47 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default 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
Reply With Quote
  #3  
Old 12-03-2008, 06:28 AM
 
tbm tbm is offline
 

Advanced Member
  
Join Date: Nov 2008
Posts: 39
 

Default 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.
__________________
Linux
X-Cart 4.1.11
Reply With Quote
  #4  
Old 12-04-2008, 12:18 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default 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)
Reply With Quote
  #5  
Old 12-10-2008, 07:45 AM
 
tbm tbm is offline
 

Advanced Member
  
Join Date: Nov 2008
Posts: 39
 

Default 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?
__________________
Linux
X-Cart 4.1.11
Reply With Quote
  #6  
Old 12-10-2008, 08:05 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default 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
Reply With Quote
  #7  
Old 12-10-2008, 08:38 AM
 
tbm tbm is offline
 

Advanced Member
  
Join Date: Nov 2008
Posts: 39
 

Default 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"
__________________
Linux
X-Cart 4.1.11
Reply With Quote
  #8  
Old 12-11-2008, 01:05 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default 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
Reply With Quote
  #9  
Old 12-11-2008, 01:17 AM
 
tbm tbm is offline
 

Advanced Member
  
Join Date: Nov 2008
Posts: 39
 

Default 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.
__________________
Linux
X-Cart 4.1.11
Reply With Quote
  #10  
Old 12-11-2008, 01:32 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default 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 ".
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 03:37 PM.

   

 
X-Cart forums © 2001-2020