Jump to content

Using Ssi For My Skin


Guest lithriel

Recommended Posts

Guest lithriel

The main portion of my website (aplusdraftingdesigns.com uses SSI for the menu and footer areas. I would like to use the same navigation.inc and footer.inc file for the cart (http://aplusdraftingdesigns.com/store/ -currently offline) so that my client only has to update links from one file.

I tried adding <!--#include virtual="/common/navigation.inc" --> to the index.tpl file located in the skins/myskin/styleTemplates/global/ directory. I even tried using a PHP include. Now I don't know much about PHP, so I'm not surprised the include files are not working. Is there anyway to use the same navigation.inc file in index.tpl and cart.tpl to skin my site without converting my entire site to PHP? What is the proper syntax?

Right now the only way I can get the site to look correct is to insert the code that would have been the menu as xhtml directly into the index.tpl file, but using the include would make my life a whole lot easier.

Link to comment
Share on other sites

CubeCart uses "xtemplate" a PHP Template class.

One feature that isn't used by cubecart (afaik), is the file include....

In a template file add:

{FILE "/common/navigation.inc"}

Use in place your SSI includes. I've just tested, and its working fine. I've been recently playing with the template class, as I may use it for a non cc project.

You can't put PHP inside the .tpl files, (but you can output data from a php file - view the "assign" commands inside /includes/content/ files)

I hope this helps,

Jason

Link to comment
Share on other sites

Guest lithriel

Thanks very much for your reply, but I'm getting a fatal error "File does not exist" :w00t: I even tried typing in the full url. Instead of using the easy absolute path "/common/navigation.inc" in your code I've used {FILE "http://aplusdraftingdesigns.com/common/navigation.inc"} and I get:

__XTemplate fatal error: file [http://aplusdraftingdesigns.com/common/navigation.inc] does not exist__

Funny thing is, if you type in http://aplusdraftingdesigns.com/common/navigation.inc it shows up just fine. So it does exist. What am I doing wrong?

CubeCart uses "xtemplate" a PHP Template class.

One feature that isn't used by cubecart (afaik), is the file include....

In a template file add:

{FILE "/common/navigation.inc"}

Use in place your SSI includes. I've just tested, and its working fine. I've been recently playing with the template class, as I may use it for a non cc project.

You can't put PHP inside the .tpl files, (but you can output data from a php file - view the "assign" commands inside /includes/content/ files)

I hope this helps,

Jason

Link to comment
Share on other sites

As a test, put the navigation file in the same directory as your store root;

http://aplusdraftingdesigns.com/store/

Then just reference the file. The "index.php" file in the store root (and cart.php) invokes the template, so any paths are relative to that location.

{FILE "navigation.inc"}

I don't know if the template engine can handle urls, so you may have to use "../common/navigation.inc" (or something like that!)

Jason

Link to comment
Share on other sites

Guest lithriel

Brilliant! It's working now and the files aren't in the store directory. The path "../common/navigation.inc" works when "/common/navigation.inc" does not. Thanks for clarifying the path that's being referenced. :w00t:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...