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

Beginners Example of Static Page with Dynamic Content

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-01-2007, 08:24 PM
 
Hunabku Hunabku is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 47
 

Default Beginners Example of Static Page with Dynamic Content

What follows is a simple example for including .tpls (and their dynamic content) in a static page. This example shows how to create a main category page that displays static page content before a dynamic listing of root categories.

Create a static page in admin, title it (ex "Our Catalog"), enter the page content and note the page id (see url ex ".../admin/pages.php?pageid=9")

At around line 7 of "customer/main/pages.tpl" replace:
Code:
{$page_content}

with:
Code:
{$page_content} {if ($smarty.get.pageid eq "9")} <br><br> {include file="customer/categories.tpl"} {/if}
Be sure to change the page id "9" above to your previously created page id.

Inside your pages.tpl you can create several if statements "id=n" for every static page that you want to include files in or alter the layout of.
__________________
Version 4.1.3
Reply With Quote
  #2  
Old 08-16-2007, 09:23 AM
 
gravel gravel is offline
 

Senior Member
  
Join Date: Mar 2004
Posts: 156
 

Default Re: Beginners Example of Static Page with Dynamic Content

This is close to what I'm trying to do. I have an empty static page, that I want to load the home page of a Knowledge Base installation.

I tried using this code:

Code:
{$page_content} {if ($smarty.get.pageid eq "53")} <br><br> {include file="library/index.php"} {/if}

But it doesn't load the page. Any idea what I'm doing wrong?

Thanks,
Dan
__________________
X-Cart version 4.0.17
X-Cart version 4.0.18
Web servers = Apache
OS = Linux
Reply With Quote
  #3  
Old 08-16-2007, 10:43 AM
 
Hunabku Hunabku is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 47
 

Default Re: Beginners Example of Static Page with Dynamic Content

You should include a tpl file not a php.
__________________
Version 4.1.3
Reply With Quote
  #4  
Old 08-16-2007, 11:52 AM
 
gravel gravel is offline
 

Senior Member
  
Join Date: Mar 2004
Posts: 156
 

Default Re: Beginners Example of Static Page with Dynamic Content

Thanks. I got it in there using a php include, but now I think that the application itself would have to be rewritten (basically) to work within an embedded page.
__________________
X-Cart version 4.0.17
X-Cart version 4.0.18
Web servers = Apache
OS = Linux
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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:46 AM.

   

 
X-Cart forums © 2001-2020