Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » changing/targeting specific area of...
changing/targeting specific area of template
changing/targeting specific area of template
Hi
I've got a noob question regarding chamelon (great joomla extension by the way). I would like the website I'm designing to use several slight variations of the main template.
My questions are-
I want the header, footer and navigation to stay the same it's only the content that appears in the main body (joomla component section) that will change. Can this be achieved using Chameleon or do I need to create a new complete template for each article.
I don't really want to have to create lots of templates that are basically the same (if that makes sense). It's only really a specific area of the template that I want to target and change for different articles.
Any advice would be very welcome, thanks.
Dan
P.S. Apologies if this is a silly question.
Re: changing/targeting specific area of template
Hi Dan,
that's a good question. Here's how I do it.
In the PHP box in the SUCCEED or FAIL action, I do this:
define("ON_SUCH_AND_SUCH_PAGE", true);
Then in the template, or anywhere else in the system (e.g. in a component, module or plugin, you can use:
if (defined("ON_SUCH_AND_SUCH_PAGE")) {
// do some stuff here based on the success of the Chameleon rule
}
Hope that helps,
Stephen
Re: changing/targeting specific area of template
The other thing you can do of course is to make modifications to your template based on CSS. There's a box in the Succeed action where you can put in some CSS code or include an external CSS file. So if you're better at CSS than PHP you could use that to modify layout, colours etc - anything that you can alter with CSS.
And this is of course as a result of the Chameleon rule, so can be targetted onto any page or for any user agent, time of day, GeoIP, whatever.
Cheers,
Stephen
Re: changing/targeting specific area of template
Hi Stephen
okay....I'll also try the css method. Basically what the situation is, is that my main template has four boxes in the main joomla component and when info in one of these boxes is selected the template changes to six boxes (so not a lot actually changes itself). I don't really want to have lots of slightly different templates installed which bloats and slows down the website.
Re: changing/targeting specific area of template
Yes, I know what you mean. The PHP code I suggested is fairly basic, and the sort of code you should learn to write in order to do basic template modifications, e.g. being able to remove certain module positions on certain pages, etc. But if you can do it with CSS then so much the better.
All the best,
Stephen
- Index
- » Chameleon / ChameleonLite
- » Chameleon
- » changing/targeting specific area of...
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5967
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 8026
- Newest User:
- rivas48750
- Members Online:
- 0
- Guests Online:
- 194
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked