[Solved] Maintain same background image on every page

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
Geoclaps
Forum Members
Forum Members
Posts: 25
Joined: Tue Oct 08, 2013 12:02 pm

[Solved] Maintain same background image on every page

Post 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.
Last edited by Geoclaps on Tue Aug 26, 2014 9:13 am, edited 1 time in total.
pete290
Forum Members
Forum Members
Posts: 54
Joined: Sat Aug 22, 2009 5:55 pm

Re: Maintain same background image on every page

Post 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.
Geoclaps
Forum Members
Forum Members
Posts: 25
Joined: Tue Oct 08, 2013 12:02 pm

Re: Maintain same background image on every page

Post 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.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Maintain same background image on every page

Post 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.
Geoclaps
Forum Members
Forum Members
Posts: 25
Joined: Tue Oct 08, 2013 12:02 pm

Re: Maintain same background image on every page

Post 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!
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Maintain same background image on every page

Post 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.
applejack
Power Poster
Power Poster
Posts: 1014
Joined: Fri Mar 30, 2007 2:28 am

Re: Maintain same background image on every page

Post 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.
Post Reply

Return to “CMSMS Core”