Due to the ability of panel pages to have several variants within one page override...

Can we get an extra drop down that populates with the available variants in the selected Panel Page id?

Maybe have the default as "All" so it acts as it does now... overriding all variants within the selected Panel Page id. Then add an option for each variant to restrict it based off that. Hmm, maybe it should be a multi-select box and not just a single drop down select. Then you can choose all of the variants you want.

I imagine there's some way to accomplish this in the Visibility textarea, but I have no clue what the code would be and it isn't exactly straightforward to research. This seems like it would be a common desire for people and would really open up the functionality of this submodule.

Thanks for all the hard work on this module. It's a godsend.

CommentFileSizeAuthor
#4 custom_breadcrumbs-846948.patch4.07 KBjames.williams
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kompressaur’s picture

I was hoping to do as you say too jay. subscibing.

MGN’s picture

sounds like it would be a good addition. I would be happy to consider a patch is anyone is able to write one. I am not sure when I'll get a chance to research this myself...

james.williams’s picture

subscribe

james.williams’s picture

Status: Active » Needs review
FileSize
4.07 KB

Here's a patch to support panels variants. I'm using optgroups in the admin interface for choosing which Panel page/variant to use, which comes out quite nicely. Admins can choose a page as before, or for where there are more than one variant for a page, either choose to apply the breadcrumbs to all variants of that page, or an individual variant.

Instead of storing what custom breadcrumbs considers the Panel ID, we should store the variant ID (name), since this is more accurate. (Or the actual panel name if applying to all variants of a panel.) However, this will mean an upgrade path is needed for any existing custom breadcrumbs set against Panel IDs. I haven't yet written that.

MGN’s picture

Thanks for this. I am testing it now and it looks good - should be able to get it committed shortly.

I have a related question that I could use some feedback on. With this patch, if you create variants of node template pages, even if you create a custom breadcrumb panels breadcrumb, it won't be applied. This is because the current code just fires hook_nodeapi for the node objects. So if you have a node-type custom breadcrumb, you will get that instead.

It seems straightforward to avoid this confusion. Just reorganize the code to check to see if a custom_breadcrumbs_panels breadcrumb is defined before checking for a node-type breadcrumb on the node context (and similarly check for a taxonomy-type breadcrumb for a taxonomy template...)

I figured I would also make this change when committing the patch in #4. Before i do that, are there any objections to this change?

james.williams’s picture

Go for it - although might it be worth making it clear that any custom breadcrumbs for a node type will be ignored if the panel variant is showed?

By the way, I have no idea how this might work/conflict with mini panels or Panel nodes (I've not used either, but I assume variants can still fire & breadcrumbs may then get picked up, despite the page not being a whole panel?). That might be worth investigating down the line.

MGN’s picture

Status: Needs review » Fixed

This new feature has now been committed to 6.x-2.x-dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.