Page using wrong page_background_image selector in 2.2.3
Posted 13 July 2012 - 09:22 PM
So now the background image css is being output in the header where it wasn't before. But the selector it's using for the image is not using the selector from the PageLinesCSSGroups class in config.selectors.php.
The function that renders the background image css do_background_image in class.render.css.php seems to check for a custom field for the page with the key of 'page_background_image_selector'. My pages don't have a custom field for that set, so it is falling back to the hardcoded default value of #page.
It seems like this selector should be defined by the result of the cssgroups function, as it is used in the get_global_meta_options function inside class.options.metapanel.php. cssgroups('page_background_image') returns the proper selector to be used.
Any help would be much appreciated Thanks!
Posted 15 July 2012 - 11:18 AM
Posted 16 July 2012 - 03:14 PM
I wanted to elaborate on what I found. The per-page background images are outputting only to the #page selector.
I did some testing in my local environment with the site background images and those are outputting to the correct (default) css selectors of .full_width #page .page-canvas, body.fixed_width but ALSO to the #page selector in the same way that the page background images are. This is very obvious when using the fixed-width mode as you can see the same background image multiple times on the page.
When the site background is set to supersize, everything looks as it should for both page and site backgrounds.
Posted 16 July 2012 - 08:27 PM
Posted 16 July 2012 - 08:34 PM
Posted 17 July 2012 - 01:48 AM
Like I mentioned in my OP (linked at the top), I am trying to change the selectors used to style the background using the pagelines_css_group filter. I used this code ( ) to do this and it worked perfectly in 2.1.6.
Shouldn't it work the same way now?
Here is a screenshot of the site I am using this on from when it was on 2.1.6 where you can see the result I am trying to get back:
Here's the link to the site again, which is currently running 2.2.4 :
Thanks so much for your help!
Posted 17 July 2012 - 12:29 PM
PHP isn't mt forte but I am not quite sure what you're trying to achieve the code you provided in the paste.
Why can you simply use the follow:
Posted 17 July 2012 - 01:56 PM
Then you can use the filter, my bad!
Posted 17 July 2012 - 02:11 PM
@Danny, allow me to explain
One of the things that makes the Pagelines framework so badass, is that it's so flexible. Because the core css is rendered on the server by php, pagelines dynamically builds the necessary css needed for each page based on what options are chosen as well as what sections are active, etc.
CSS needs selectors to target elements, so the framework has a set of selector groups with default values for these. The thing that is so awesome about this is that these are available to be changed or extended upon on the fly if you want. In this case, I'm not trying to do anything crazy. I am merely changing the selectors pagelines assigns it's background image styles to, but there are also groups for typography, and other colors. So if you wanted to say, extend the styling of the secondary font to another selector, you could do that with this filter, and pagelines would do all the css for you.
Why not just use some simple css like you suggested? Well because that would be too much work lol. Now that sounds ridiculous, but in the context of using Pagelines Framework, IT IS. Because I can just change the selector, and then I can use the options and controls that are built right into every page in the page meta setup to choose my background, position it, and everything, without ever having to touch css. The real value is that anyone (ie: my client) can change the image without breaking a sweat.
Powerful stuff. Thanks @pross!