Page 1 of 1

[Solved] Maintain same background image on every page

Posted: Tue Aug 12, 2014 8:26 am
by Geoclaps
The question seems simple and probably there is a very easy way to fix this within CMSMS.

The current situation is as follows:

Client can select an image from the dropdown in the edit section of any page wich will function as the background-image on that specific page. In this case that's not what my client wants.

So: select an image from a random page results in setting this image on every other single page but with the possibility of changing that image on every random page.

Is there a smarty that can be set at one page but effect all pages? In this case a smarty that selects an background image wich than is used by every page?

In the current situation I made an HTML block wich is included in the template of every general page:

Code: Select all

{content_image block='image' label='Select background photo'  tab='Background photo' exclude='_thumb' class='bg-photo' dir='images/backgrounds/' alt="Description"}
Hope you guys can relate to this. If not let me know.

Re: Maintain same background image on every page

Posted: Tue Aug 12, 2014 8:46 am
by pete290
Not sure why you would set the background image like this, rather than with CSS. But if you do want to target a specific page you can just use {if $page_alias=='whatever'}{/if} in your template.

Re: Maintain same background image on every page

Posted: Tue Aug 12, 2014 9:28 am
by Geoclaps
That's the whole point. In the current situation the client can select one image per page so every page can have a unique image wich is used as a full page background.

But.. I want to make it possible for the client to select an image and set it for the whole template. E.g. if I use template-text" and the clients sets the (background) image to "background1.jpg" all other pages with that template should also get that image.

In short: there needs to be a dropdown in the backend that can select one image from a folder wich than is used by every single page of one specific template.

Re: Maintain same background image on every page

Posted: Tue Aug 12, 2014 9:43 am
by velden
Though I never used it I think that Custom Global Settings module can do it.

Perhaps you want to combine it with GBFilePicker.

It would be nice to read if it suites your needs and how you used it.

Re: Maintain same background image on every page

Posted: Wed Aug 13, 2014 7:24 am
by Geoclaps
Hi Velden, thanks for the reply. I have used that module before (http://forum.cmsmadesimple.org/viewtopi ... pen+closed) but doesn't fits the needs in this specific situation. The website that is using this module is at http://www.ijsclubvosbergen.nl. Module is linked to the image at the top right corner of the site wich can be flagged as "off" and "on" in the backend wich means the iceskating lanes are "closed" or "open". Obviously cloded now :) but during the winter season it comes in handy!

If anybody else has some sugestions I would be happy to hear them. Thanks in advance!

Re: Maintain same background image on every page

Posted: Wed Aug 13, 2014 7:35 am
by velden
But it also has field definitions for GBFilePicker which gives editor possibility to select an image from a directory (or upload an new one).

I would think that's exactly what you need.

Re: Maintain same background image on every page

Posted: Thu Aug 14, 2014 1:55 am
by applejack
You can just use the standard CGB, capture the content and check if it exists etc etc.

Or if you can get the client to set the image on a specific page i.e. About us and e.g. all child pages use that template use CGISimpleSmarty module.