Shape 5

Joomla Templates => Oasis - Club => : tori033 March 13, 2014, 04:39:06 AM



: Specify multiple image backgrounds
: tori033 March 13, 2014, 04:39:06 AM
Hi,

I'm using Joomla 3.2.

I see that I can set a specific background image in the template options but I would like to have various (specific) backgrounds depending on where you are on the site.

In some of my other web sites I have achieved this by adding a class (e.g. myClassName) on the Menu Item > Page Display > Page class and adding the background image via CSS like this:

body.myClassName {background: url(../images/backgrounds/myBackgroundImage.jpg) top center no-repeat background-size: 100% }

However if I do this in the Oasis template the Page Class is not added to body but to a div inside component_wrap_inner.

Is it possible to work around this and be able to specify classes on the body element? Or any other way?

Thanks.


: Re: Specify multiple image backgrounds
: mikek March 13, 2014, 07:17:05 AM
Hello,

The only way you could change backgrounds on specific pages is to make multiple template styles in the template manager and then assign specific styles to individual pages.


: Re: Specify multiple image backgrounds
: tori033 March 13, 2014, 07:35:37 AM
Thank you for the quick feedback on this.
At least there's an alternative then even if it's a bit fiddly.


: Re: Specify multiple image backgrounds
: clw888 March 13, 2014, 11:01:34 AM
Mike makes sense 99% .9 of the time,listen to Mikey. but did you say , "specific background image" , you mean change image, well, that is not changing the template in Oasis, the front page "IMAGE" , the big one, , that Image???? Why not just set - copy your module to the page you want, and make a "new image" that way, but if you say you want a different "template" look, Yea, mike has it, : Question: why in the world are you trying to re-code the template script to get a change of an "Image"????


: Re: Specify multiple image backgrounds
: mikek March 13, 2014, 11:29:01 AM
Hello,

They are not trying to alter the template, the suggestion I posted above will work.


: Re: Specify multiple image backgrounds
: tori033 March 13, 2014, 05:17:37 PM
Mike makes sense 99% .9 of the time,listen to Mikey. but did you say , "specific background image" , you mean change image, well, that is not changing the template in Oasis, the front page "IMAGE" , the big one, , that Image???? Why not just set - copy your module to the page you want, and make a "new image" that way, but if you say you want a different "template" look, Yea, mike has it, : Question: why in the world are you trying to re-code the template script to get a change of an "Image"????

I think you got me wrong. The template allows the use of a background image but it has to be the same image on all pages and I wanted to have different background images depending on which page you are on. I have done this in other templates via CSS (without re-writing any template code) and was looking for a similar solution.


: Re: Specify multiple image backgrounds
: mikenicoll March 13, 2014, 05:27:38 PM
Hello ,

The only way to accomplish this would be as Mikek said. Adding additional Template Styles and assigning them to specific Menu Items will allow you to add alternate styling for specific pages.

-Mike