• 0
Sign in to follow this  
Followers 0

Page using wrong page_background_image selector in 2.2.3

Question

Posted · Report post

This is a follow up issue to my original question here. 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!

Share this post


Link to post
Share on other sites

11 answers to this question

  • 0

Posted · Report post

Hi, Thanks for reporting this, i'll bring this to the developers attention.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks Danny, Please let me know what comes of it.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

@Danny, 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 [i]site[/i] background images and those are outputting to the correct (default) css selectors of [u].full_width #page .page-canvas, body.fixed_width[/u] 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. [URL=http://imgur.com/8o1Ln][IMG]http://i.imgur.com/8o1Lnl.png[/IMG][/URL] When the site background is set to supersize, everything looks as it should for both page and site backgrounds.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I'll update this info to the developers.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I'm informed this is resolved in the next release.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks @rangelone, any idea when the next release is coming out? I'll accept an answer here as soon as I have things working on my end.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

The fix was posted by me on sunday, well yesterday lol.. so you can just scroll back a few posts and find it or wait ;)

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

@pross, after upgrading to 2.2.4, I see things are different than before, but I still can't achieve the result I am looking for. Like I mentioned in my OP (linked at the top), I am trying to change the selectors used to style the background using the [u]pagelines_css_group[/u] filter. I used this code ([url="http://paste.pagelines.com/055"]see my paste here[/url]) 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: [URL=http://imgur.com/udxyT][IMG]http://i.imgur.com/udxyTl.jpg[/IMG][/URL] Here's the link to the site again, which is currently running 2.2.4 : [url="http://wellspring.bxbmedia.com/"]http://wellspring.bxbmedia.com/[/url] Thanks so much for your help! :)

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi, 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: [code].page-canvas { margin: 0 auto; background-image: url(http://wellspring.bxbmedia.com/wp-content/uploads/2012/06/page_bg-market-landing.jpg); background-position: 100% 0%; background-repeat: no-repeat; background-attachment: scroll; }[/code]

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

No hes right, replace line 155 of class.render.css.php with: [code] $sel = cssgroup('page_background_image'); [/code] Then you can use the filter, my bad!

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

@pross, MY SAVIOR! :) @Danny, allow me to explain :) One of the things that makes the Pagelines framework [i]so badass[/i], 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 [i]on the fly[/i] 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 [b]too much work[/b] 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 [b]page meta setup[/b] to choose my background, position it, and everything, without ever having to touch css. The real value is that [i]anyone[/i] (ie: my client) can change the image without breaking a sweat. Powerful stuff. Thanks @pross! ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0