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

Include tpl in static page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-01-2011, 08:14 AM
 
Sruly Markowitz Sruly Markowitz is offline
 

Member
  
Join Date: Mar 2011
Posts: 13
 

Default Include tpl in static page

I want to use htaccess to point to a static page as my home page. This is because my categories and other dynamic content will not be changing often, but my design will, and I do not want to have to call a developer every time I want to add a banner or a promotion to the front page. I am proficient in HTML CSS but not in smarty/php

However, I do want to include the quicksearch feature (quicksearch.tpl) in my static page.

My static page is at root level (I skinned it to match the xcart theme exactly), so how do I go about including the quicksearch.tpl feature in my static page?

Thanks

P.S.
I tried
{PHP}
{include file="skin/storesigns-2column/customer/quicksearch.tpl"}
{/PHP}

but that didnt work
__________________
4.4
Reply With Quote
  #2  
Old 07-01-2011, 12:09 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Include tpl in static page

You don't need the {php} tags and you don't need to include the skin directory. Something like this should be all you need:
Code:
{include file="customer/quicksearch.tpl"}
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #3  
Old 07-05-2011, 06:20 AM
 
Sruly Markowitz Sruly Markowitz is offline
 

Member
  
Join Date: Mar 2011
Posts: 13
 

Default Re: Include tpl in static page

That works, thanks. But is there a way to make it work on root level static pages.
The 'parse smarty tags' checkbox is enabled, but it is only for embedded static pages.

Thanks
__________________
4.4
Reply With Quote
  #4  
Old 07-05-2011, 10:37 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Include tpl in static page

Nope, not in static html files.

There are ways around this like adding something to htaccess so that all of your html files are parsed for php then adding X-Cart's php/smarty framework to the top of the html file, but I wouldn't recommend doing that.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #5  
Old 07-06-2011, 08:42 AM
 
Sruly Markowitz Sruly Markowitz is offline
 

Member
  
Join Date: Mar 2011
Posts: 13
 

Default Re: Include tpl in static page

Do you mean adding
AddHandler application/x-httpd-php5 .html .htm
to my htaccess

What do I have to do (X4.4) to add the smarty php framework to the top of my html file?

I'd like to try it this way. I think in the long run it will be simpler than using an embedded page.
__________________
4.4
Reply With Quote
  #6  
Old 07-06-2011, 11:09 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Include tpl in static page

Typically if you need a new page with php/tpl functionality you would create another php page like the ones that X-Cart already includes, add an entry to customer/home_main.tpl, and add a new tpl file.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
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 01:55 PM.

   

 
X-Cart forums © 2001-2020