- Joomla 2.5.8
- Yootheme Template 2012
What?
For any web-developer who can program in PHP/HTML, this would be easy to hard-code and override. However, the article below demonstrates how to make this an option that your client can switch off/on using the Joomla Admin Panel.
How?
For demo purposes, I'm going to add the background "Ambient Turquoise". Yootheme uses CSS files to do this so we'll need to modify the XML file and add some files that this will select.
- Modify \templates\<yootheme_template>\config.xml add the select option "Ambient Turquoise" to the end of the list:copyraw
<fields name="Profiles"> <field name="Style" type="separator" /> <field name="style" type="styles" default="" label="Style" description="Select the style variation." /> <field name="background" type="list" default="grey" label="Background" description="Select the background."> <option value="grey">Grey</option> <option value="dots">Dots</option> <option value="tartan">Tartan</option> <option value="lines">Lines</option> <option value="dark_squares">Dark Squares</option> <option value="light_squares">Light Squares</option> <option value="mosaic">Mosaic</option> <option value="turquoise">Turquoise Color</option> <option value="ambientturquoise">Ambient Turquoise</option>
- <fields name="Profiles">
- <field name="Style" type="separator" />
- <field name="style" type="styles" default="" label="Style" description="Select the style variation." />
- <field name="background" type="list" default="grey" label="Background" description="Select the background.">
- <option value="grey">Grey</option>
- <option value="dots">Dots</option>
- <option value="tartan">Tartan</option>
- <option value="lines">Lines</option>
- <option value="dark_squares">Dark Squares</option>
- <option value="light_squares">Light Squares</option>
- <option value="mosaic">Mosaic</option>
- <option value="turquoise">Turquoise Color</option>
- <option value="ambientturquoise">Ambient Turquoise</option>
- Add a \templates\<yootheme_template>\css\background\ambientturquoise.css file. Note the same filename as in the option value of the previous step.
- If using an image, create a folder and add the image matching the path in the previous step: \templates\<yootheme_template>\images\background\ambientturquoise\ambientturquoise.jpg
- Test by logging into the Joomla Admin Panel > Extensions > Template Manager > Styles > "Select the Background" > Save/Apply
- Done!
Additional Note
- I do not work for Yootheme.
- I did not post this to Yootheme forums because you have to be a paying member to access these and I tend to piggyback on my client's subscriptions.
- This information does not come from Yootheme forums.
- I am too lazy to answer/update my solutions in 3rd-party forums.