Jump to content

Custom XTemplate Based on Category?


Guest bababooey

Recommended Posts

Guest bababooey

I need to show a custom View Category template based on the catID in the URL. I'm having problems determining how to query for the right categories. For example, I have one category that should be laid out a little different, and its category ID is 1. I need all of its SUBcategories to also use this template. So, I've made a new template:

$theid = $_GET['catId'];

if (($theid == 1)|| ()){

$view_cat = new XTemplate ("skins/".$config['skinDir']."/styleTemplates/content/newviewCat.tpl");

}else{

$view_cat = new XTemplate ("skins/".$config['skinDir']."/styleTemplates/content/viewCat.tpl");

}

and I need to construct the "if" statement. I can get this to work for the category, but not the subcategories. I need to say, "If the catID is 1, or if the catID's cat_father_ID is 1, use newviewCat.tpl". So, everything that is either category 1, or whose Father Category ID in the database is 1, should use the new template - all other categories use the normal template.

This seems like a simple query. Can someone help, or point me to an existing mod? Thanks!

Link to comment
Share on other sites

Guest bababooey

Would you like this feature for every or some of top level categories? If so there is a mod in cubecart.org forum. Just send me a PM we can sort this out.

Currently, I only need this on one top level category, but it's possible I might need it for more than one. Basically, if the catID is 1, or the catID ISN'T 1, but it has a cat_father_ID of 1, then I need to show my custom View Category template. So I think I need that "Category Father ID" check.

I see the mod here: http://www.cubecart.org/forums/index.php?showtopic=210

Just wondering if that would work for the subcategories of the top level category as well? Thanks!

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...