Templates SUFFIX

More
12 years 7 months ago #18872 by igcorreia
Templates SUFFIX was created by igcorreia
I have an problem and could this problem become a feature :D

I have 2 categories that uses the same template so this means that I have to use the SAME DESIGN in both categories :/

But I actually want to use a Category Suffix so one can have a Black Background and the other a Withe background.

The idea here is NOT TO DUPLICATE the template, because they ACTUALLY use the same one. And for maintenance it easier to only have one, because we are talking about 25 custom fields.

What do you think? You could apply the same tecnic that you use in the fields as a class suffix but in the entire template.

Does this makes sense?

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #18874 by ggppdk
Replied by ggppdk on topic Templates SUFFIX
What you ask is already there.

Let's say your template is called my 'mytemplate1'

Inside the template folder 'mytemplate1' there is a category.xml file that has the parameters of the template per category.

e.g. between
Code:
<params ...> ... </params>
add
Code:
<params ...> <param name="custom_bgcolor" type="text" size="4" default="#FFFFFF" label="Background Color" description="Background Color of the category page" /> </params>
This and any other parameters you add there, will appear in category edit page.

at the Group "Layout Parameters"
inside the slider "Parameters: mytemplate1"

Go ahead and replace the default value of '#FFFFFF' with e.g. black etc

Inside your template php files you can use the parameter like this:
Code:
defined( '_JEXEC' ) or die( 'Restricted access' ); ?> <?php $custom_bgcolor = $this->params->get( 'custom_bgcolor', '#FFFFFF' ); ?> <div id="flexicontent" class="flexicontent" style='background-color:<?=$custom_bgcolor?>;'>

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #19184 by igcorreia
Replied by igcorreia on topic Templates SUFFIX
Thank you. We will give it a try.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.270 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline