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

Enabling Smarty on non x-cart pages of site

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-08-2003, 11:14 AM
 
Cameron Cameron is offline
 

eXpert
  
Join Date: Jan 2003
Location: Washington State, USA
Posts: 224
 

Default Enabling Smarty on non x-cart pages of site

In asking the question in this thread: http://forum.x-cart.com/viewtopic.php?p=10049
it occurs to me that maybe what I need to do is to enable smarty on all of the non x-cart pages of my site so that I can include smart templates.

Can anybody point me to a resource on how to do this? I have several site pages that I want to have *outisde* of x-cart, but I still want somebody viewing those pages to see their menu_cart.tpl so they know what is in their cart.

I just need all of my pages to show the menu_cart.tpl news.tpl auth.tpl etc, *even* if they're not in the /xcart/ directory.

I *really* don't want to use a page redirect to take somebody straight into /store/customer/home.php when they come to www.mydomain.com/
BUT if that is the only way to make it work, then I will.

If that is my only solution, is there a way to make the page stay as mydomain.com/index.php instead of redirecting? I'm using this code:

<?php
Header("Location: /store/customer/home.php"); exit();
?>

Which changes the URL to /store/customer/home.php -- I'd like for the public (and *especially* the SE spiders) to think that they are seeing mydomain.com/index.php

Thanks,
Cameron
Reply With Quote
  #2  
Old 03-08-2003, 05:40 PM
 
Cameron Cameron is offline
 

eXpert
  
Join Date: Jan 2003
Location: Washington State, USA
Posts: 224
 

Default

I decided that I needed to just get this done and not worry about what directory the files are in. They're not over two directories deep, so the SE spiders shouldn't pooh on the site. BUT I also knew I didn't want to have a help.php?section= type of link since spiders hate question marks, and the HTML catalog appears to only be for products.

So here was my solution. Hopefully it will help other people, too.

I opened /store/customer/home.php and saved it as:

/store/customer/choose.php

Then I Modified:
Quote:
#
# Assign Smarty variables and show template
#

$smarty->assign("main","choose");
$smarty->assign("location",$location);
$smarty->display("customer/home.tpl");
(only the first $smarty variable is changed from the original)

Next I went into store/skin1/customer/home_main.tpl and added:

Quote:
{elseif $main eq "choose"}
{include file="customer/main/choose.tpl"}

Then finally, created customer/main/choose.tpl based on welcome.tpl

Now I have /store/customer/choose.php with all of my x-cart .tpl files in it. It's not the ideal solution of having choose.php be in my root foler, but it works.

Cameron
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 02:37 AM.

   

 
X-Cart forums © 2001-2020