Jump to content


Photo
- - - - -

Page using wrong page_background_image selector in 2.2.3


  • Please log in to reply
11 replies to this topic

#1 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 13 July 2012 - 09:22 PM

This is a follow up issue to my original question

Please Login or Register to see this Hidden Content

.

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!

#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 15145 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 15 July 2012 - 11:18 AM

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

#3 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 15 July 2012 - 03:03 PM

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

#4 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 16 July 2012 - 03:14 PM

@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 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.

Please Login or Register to see this Hidden Content



When the site background is set to supersize, everything looks as it should for both page and site backgrounds.

#5 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 16 July 2012 - 06:56 PM

I'll update this info to the developers.

#6 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 16 July 2012 - 07:00 PM

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

#7 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 16 July 2012 - 08:27 PM

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.

#8 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 16 July 2012 - 08:34 PM

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 ;)

#9 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 17 July 2012 - 01:48 AM

@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 pagelines_css_group filter. I used this code (

Please Login or Register to see this Hidden Content

) 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:

Please Login or Register to see this Hidden Content



Here's the link to the site again, which is currently running 2.2.4 :

Please Login or Register to see this Hidden Content



Thanks so much for your help! :)

#10 Danny

Danny

    Is Awesome!

  • Moderators
  • 15145 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 17 July 2012 - 12:29 PM

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:

Please Login or Register to see this Hidden Content



#11 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 17 July 2012 - 01:56 PM

No hes right, replace line 155 of class.render.css.php with:

Please Login or Register to see this Hidden Content

Then you can use the filter, my bad!

#12 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 17 July 2012 - 02:11 PM

@pross, MY SAVIOR! :)

@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! ;)