 |

snaketorque
User
Dec 9, 2006, 7:32 AM
Post #1 of 9
(492 views)
Shortcut
|
|
Category Help and header
|
Can't Post
|
|
Hi I have installed AM2 and will be running 2 discrete sections of the site, a racing and a tuning section. I have the article pages being published correctly to the distinct directories, and I have a header publish rule defined with seperate headers pages. Both header pages are being generated, however the include within the pages is to the same header on both disctinct directories as opposed to the header located within the diretories, for example on all article pages it is pointing to /tuning/headerfile but I would expect the page to just reference to the header file located in its directory. Any ideas because I am stumped. Thanks Robert
|
|
|  |
 |

snaketorque
User
Dec 9, 2006, 8:02 AM
Post #2 of 9
(489 views)
Shortcut
|
|
Re: [snaketorque] Category Help and header
[In reply to]
|
Can't Post
|
|
Update I have 2 header publishing rules, they both defined different header templates. The publish directory is also different for both publishing rules. I also have 2 seperate publishing rules for the article pages, again soecifying different directories, but the actual page template is common. Thanks Rob
|
|
|  |
 |

ross
Staff
/ Moderator

Dec 10, 2006, 3:22 PM
Post #3 of 9
(472 views)
Shortcut
|
|
Re: [snaketorque] Category Help and header
[In reply to]
|
Can't Post
|
|
Hi Rob. Thanks for posting and welcome to the board! I think what you'll be able to do here is use what are called templateif's to get this going. Basically, you'll put some code on your template that says, if the article you are looking at is from category 1, show the first header. If it is from the other category, show the second header. The code for that would look something like this:
<!-- templateIf : $category.num$ == "1" --> <!-#include virtual="placeholder for header 1" --> <!-- /templateIf --> <!-- templateIf : $category.num$ == "2" --> <!-#include virtual="placeholder for header 2" --> <!-- /templateIf --> You just need to swap in your category numbers and the appropriate include paths and that should be it. Does that make sense? Give it a shot and remember republish your articles . ----------------------------------------------------------- Cheers, Ross Fairbairn - Product Specialist support@interactivetools.com
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

snaketorque
User
Dec 10, 2006, 3:45 PM
Post #4 of 9
(470 views)
Shortcut
|
|
Re: [ross] Category Help and header
[In reply to]
|
Can't Post
|
|
I also have subcategories, I presume that this won't work on the subcats as they are a different cat number. For example, racing main category is ref 21, the BMW race reports is cat ref 24 but need the same racing header. Rob
|
|
|  |
 |

ross
Staff
/ Moderator

Dec 10, 2006, 4:32 PM
Post #5 of 9
(467 views)
Shortcut
|
|
Re: [snaketorque] Category Help and header
[In reply to]
|
Can't Post
|
|
Hi again Rob. That's not going to be a problem. You can just add some more templateif's to accomodate the additional categories. For example:
<!-- templateIf : $category.num$ == "1" --> <!-#include virtual="placeholder for header 1" --> <!-- /templateIf --> <!-- templateIf : $category.num$ == "2" --> <!-#include virtual="placeholder for header 1" --> <!-- /templateIf --> <!-- templateIf : $category.num$ == "3" --> <!-#include virtual="placeholder for header 2" --> <!-- /templateIf --> <!-- templateIf : $category.num$ == "4" --> <!-#include virtual="placeholder for header 3" --> <!-- /templateIf --> <!-- templateIf : $category.num$ == "5" --> <!-#include virtual="placeholder for header 1" --> <!-- /templateIf --> See how I have 5 templateifs? The first two are using 1 include and the second two are using a different include. The fifth one switches back to using the first include again. Does that make sense? Let me know what you think . ----------------------------------------------------------- Cheers, Ross Fairbairn - Product Specialist support@interactivetools.com
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 |

ross
Staff
/ Moderator

Dec 10, 2006, 5:11 PM
Post #7 of 9
(462 views)
Shortcut
|
|
Re: [snaketorque] Category Help and header
[In reply to]
|
Can't Post
|
|
Hi Rob. I got a new idea here . Since there is going to be a lot of categories involved here, I am wondering what exactly is changing from category to category in the header. Is it just an image and maybe a block of text? If that is the case, or it is something similar, it's actually going to work better if we created a couple new fields in your category table so you can enter these details into the categories themselves. That way, you wouldn't have to worry about custom templates for each category. The header stuff will pull in from those fields you setup automatically for each category. Let me know what you think and what is going to change for each category. ----------------------------------------------------------- Cheers, Ross Fairbairn - Product Specialist support@interactivetools.com
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 | |  |
 |

ross
Staff
/ Moderator

Dec 12, 2006, 8:31 AM
Post #9 of 9
(437 views)
Shortcut
|
|
Re: [snaketorque] Category Help and header
[In reply to]
|
Can't Post
|
|
Hi Rob. Thanks for the sample links. Now that I can see what's happening in your header, I actually have another new idea . The first thing though, are those menu's being created by Article Manager? Or when you say you are hard coding things onto the page, does that include these menus? If they were just being hardcoded onto your page, here's what I am thinking you could do. Create one new file for each of your categories (that has all the code for the menu in it) and name them the same thing as the category they are for. You may want to keep all these files in a seperate folder just to keep things organized. Now, on your templates, you would just need to do an include like this: <!--#include virtual="$category.name$.shtml" --> Just adjust the path so that it points to your files in the right place. Do you think that would work? Let me know . ----------------------------------------------------------- Cheers, Ross Fairbairn - Product Specialist support@interactivetools.com
Hire me! Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.
|
|
|  |
 | |  |
|