Jump to content
Sign in to follow this  
ksnyde

An Explicit Sidebar Call

Recommended Posts

ksnyde

I created my own Section which is a "fork" of the Pagelines "Content" section that I'm calling "SensorSingle". I added a filter hook to remove the "pagelines_post_header" (thanks Simon for that) and now I want to put the final touch on this ... I want to explicitly state the sidebar that I want loaded into SB1. Clearly the "magic" is happening somewhere in the call to the get_sidebar() function but having dug around I still don't see the method of changing this in a Pagelines friendly way. Here's the relevant code snippet (identical to what's in the PageLines Content section): code snippet I was looking at some of the conditional logic that precedes the get_sidebar and it looked potentially interesting until I realised that it is not evaluating to TRUE and therefore not having any effect right now. However, I do wonder if some of these calls aren't useful in doing what I'm trying to do.

Share this post


Link to post
Share on other sites
gyoery
Sry, cant really help u directly, but there is a plugin (actually tons) that let you use different sidebars on different pages. Maybe that would be the easy way to go, or, @ least a better place to hope for an appropriate answer.

Share this post


Link to post
Share on other sites
Jenny
[url="http://wordpress.org/extend/plugins/widget-logic/"]Widget Logic[/url] is one of those ;)

Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

Share this post


Link to post
Share on other sites
ksnyde
@simple_mama, correct me if I'm wrong but what "widget logic" does is provide conditional logic at the widget level. It doesn't help in loading or not loading an entire sidebar container.

Share this post


Link to post
Share on other sites
ksnyde
I just want to say when you configure a particular template to use the "XYZ" section instead of the standard "Content" section it should always load sidebar "sb_XYZ". Now, within sb_XYZ there may be widgets that use further logic which is where I'd use Widget Logic.

Share this post


Link to post
Share on other sites
Danny
Hi, So you actually want to have more sidebar ?

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
ksnyde
Yes I do. For instance let's say I have three custom post types: A, B, and C. When-ever I'm viewing the archive or single pages of these types I'd like to have a specific sidebar up. Within those given sidebars I'll use Widget Logic to determine which widgets should display based on user privileges and whether is_single(), etc. Does that make sense? In any event, I'm trying to understand the "call-stack" for producing a sidebar and in the Content section its clear that the get_sidebar() function is at the top of the stack but I'm not sure how to effect it's operation so as to force my particular sidebar to display. I thought maybe it was just a parameter I could pass in but I haven't gotten that to work. I also thought -- after having glanced at the PageLines Developer Docs -- that maybe I could just call pagelines_draw_sidebar from within my section but I haven't yet tried that. I'm just looking for people with more experience in this area to point me in the right direction. I'm sure there are plenty of people who have done this before. I also would guess there's more than one way to skin this cat so I'd love to benefit from someone else's wisdom before I set off on a path. Thoughts?

Share this post


Link to post
Share on other sites
Rob
Ken, to answer your last paragraph, the problem is other than our Pros and Developers, there's no one who's trying to create new sidebars, really. We offer quite a few and with Widget Logic, you get to layer them, so a sidebar in a particular place can multi-task, providing some widgets to some areas or sections, and hiding them in others. I think the problem you'll face in creating new ones is that the sidebar has a specific place on your page construction. As a result, if you tried to use a sidebar you create, we'll call it Quatro, in place of let's say the Secondary for some things, it can't actually replace it. You'd have to use the Quatro sidebar in a different template. Well, since you want a sidebar in the same place let's say, then Widget Logic works for that just as well without the heavy coding. If you're trying to create new ones for unique places, with essentially seven or eight (I've lost count) sidebars now, you should have enough to construct any possible page layout.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
ksnyde
I'm almost done with a solution I think will work. I now have a system of creating new sidebars (as PageLine sections) which are not destructive to the widget configuration. This was achieved from some great help from @cais. I have also created a section (and eventually will create several sections) which I will associate with Custom Post Types. These new sections will mimic the bahaviour of the "Content" section that comes with Pagelines but will statically control which sidebar is loaded so that every Sensor page (Sensor is an example of a CPT) will load a Sensor sidebar. The remaining problem is I need some help in how to call the code to load a specific sidebar. It looks like pagelines_draw_sidebar was intended for something like this but I'd really love to see a code example of it being used as it's signature is throwing me off a bit. For instance, how do I get the widget ID of a sidebar? is that the same as it's priority as set by pagelines_register_sidebar? If pagelines_draw_sidebar isn't the right approach, is there a filter I can hook into that will allow me to achieve this result?

Share this post


Link to post
Share on other sites
Rob
Ken, This level of customization is simply not supported in the forum or by PageLines. You're looking to create a customization that has merit, but requires the assistance of one of our Pros. Please address this by seeking a quote from one of them as we cannot provide the answers here that you're looking for. I'm sorry but this is [u]the only possible answer[/u] on this matter. http://www.pagelines.com/pros

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
cais
@ksnyde - Ken, I would agree with Robert (@rangelone) on this in the matter of using a plugin such as Widget Logic. The idea you are describing, although very interesting, could also be very complex to accomplish. It really does read like you are wanting to re-invent the Widget Logic wheel.

Share this post


Link to post
Share on other sites
ksnyde
@cais and @rangelone ... I'm very disappointed. Maybe you're making the right call but you need to know that from my perspective this is very disappointing. Pagelines is a premium product and therefore should be aiming to support not just Blog++ but applications and applications will often require (or at least strongly "desire") the functionality that I'm asking for. Using a Widget Logic approach is far from ideal and to top it off I'm still 99% sure that the solution is VERY easy if you're familiar with all the API's and hooks (which I am not). I don't think you made the right decision and you have compounded this by "accepting" my issue for me rather than letting me come to this conclusion. I think you'll see I have a history of being quite reasonable and "accepting" when things come to a natural stopping point (even if they're not what I had wished for). Up to now I'd been a very vocal proponent of PageLines and your support offering in particular. I may get over this but it has made an impact on my perception. I'm very disappointed.

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  

×