Empty Sidebars & Widget Logic

General questions pertaining to how certain issues can be resolved. This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.
Forum rules
This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.

1. No offensive language and no mocking
2. Please do a thorough search before you post something. Trust us, there is a high probability that the question you are asking has been asked previously.
3. No soliciting. You cannot post here soliciting bids for people offer you quotes, or even offer money to people for some work. You will be moderated if you do so. If you are looking for help, please post your request on http://jobs.wordpress.net or http://codepoet.com
4. Please be reasonable. You are getting software and support. For free. Complicated requests from a general purpose theme are not welcome and some volunteers might lose patience with you.
5. Please do your due diligence. If you posted a query and we answered with a link, take the trouble to go through the link contents.
6. Please post with complete information. Requests for help MUST be accompanied with your URL, particularly if you are asking something like "Why am I seeing a blank space?"
Locked
JesperWe
Posts: 12
Joined: 30 Jun 2010, 10:22

Empty Sidebars & Widget Logic

Post by JesperWe » 23 Jan 2011, 08:33

The issue of using Widget Logic to remove all widgets in a sidebar on certain pages has been brought up a couple of times:

http://www.aquoid.com/forum/viewtopic.p ... 9117#p9148
http://www.aquoid.com/forum/viewtopic.p ... 091#p11091

The problem is that when Widget Logic is used to remove all widgets in the sidebar you get an empty area in the page instead of the whole sidebar getting removed.

The CSS workaround described in the first link above is a bit unflexible, since it relies on the class of the body tag.

Would it be possible somehow to make the main column fill out to the unused sidebar area on pages where Widget Logic has removed all widgets??

/j

Colin
Posts: 5066
Joined: 27 Oct 2009, 10:46

Re: Empty Sidebars & Widget Logic

Post by Colin » 23 Jan 2011, 09:40

Sorry I can't help you with this problem :cry: BUT thank you very much for posting the links that you did because they helped me solve a problem I was having with the widget area below header. :D

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: Empty Sidebars & Widget Logic

Post by sayontan » 23 Jan 2011, 12:01

The CSS workaround described in the first link above is a bit unflexible, since it relies on the class of the body tag.
Why is it inflexible? The class is generated by the body_class call of WP, which is used for a lot more critical handling in the theme, like the widths and sidebar positioning etc.

Nonetheless, there will be something to take care of this in a release very soon (not the next release though).

JesperWe
Posts: 12
Joined: 30 Jun 2010, 10:22

Re: Empty Sidebars & Widget Logic

Post by JesperWe » 23 Jan 2011, 13:19

Because I can write a lot more sophisticated rules using Widget Logic (in PHP) than I can for the dependence on a certain body tag classes (in CSS).

Plus I find coding the behavior of the page in two different places and languages somewhat less elegant.

Looking forward to your implementation!

Thanks,
/j

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: Empty Sidebars & Widget Logic

Post by sayontan » 23 Jan 2011, 13:28

Because I can write a lot more sophisticated rules using Widget Logic (in PHP) than I can for the dependence on a certain body tag classes (in CSS).
Some examples would help. Basically the "certain body tag classes" that you mention is not CSS - it is generated by PHP, based on probably the same rules that you will embed in your Widget Logic conditions. E.g. if you use something like is_page(43), that is akin to saying "body.page-id-43" in CSS. At the end of the day, even if you exclude all your widgets from a sidebar for a particular page, I would have to tackle the exclusion of the sidebar from the page using CSS (if Widget Logic leaves a sidebar shell, i.e.) - there is no escaping that.

JesperWe
Posts: 12
Joined: 30 Jun 2010, 10:22

Re: Empty Sidebars & Widget Logic

Post by JesperWe » 23 Jan 2011, 13:40

Just a simple example of what I am thinking about: There are two widgets in a sidebar. one widget has widget logic = "is_home()" and the one has widget logic = "comments_open()". When I am displaying a post that does not have comments open I would like the sidebar to go away.

sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Re: Empty Sidebars & Widget Logic

Post by sayontan » 23 Jan 2011, 13:45

Ah, I see. Thanks.

Locked