I'm planning on using panel pages to override the standard drupal display of nodes (using the node/% method described in the handbook) to take advantage of the fantastic opportunities the panels 2 context gives me.
But breadcrumbs are giving me a headache.
Before I decided to go down the panels road I had the custom breadcrumbs module set up to create breadcrumbs according to content type. But as panel pages overrides the node display, node/1234 is no longer a node, it is a panel page and thus custom breadcrumbs can no longer do its job.
I have tried setting up Workflow NG to do the job, but I have not successfully managed to trigger by content type (once again, it is no longer a node, it is a panel page).

Any advice will be very much appreciated

Comments

ramriot’s picture

I'm Having this issue too, I tried using a workflow_ng configuration with custom PHP as the filter. The normal global URL variable was blank so that did not work.

What would be most useful is for someone to list what is in the Variable stack for a panel that can be used as a trigger, for some reason I cannot get Devel to show me them in a panel.

i.e. What variable do we need to make global in custom PHP to grab the name of the Panel.

Vidarls’s picture

Category: support » feature

I found a solution using workflow_ng and path_auto:
I'm using path_auto to create paths for my nodes i.e.: knowledge/questions/title-of-question.html
I then use workflow ng to create breadcrumbs based on that path:

  1. Create a rule triggered by "user is going to view a page"
  2. Create a condition: textual comparition
  3. Make the top line [user:url], hook of for using regex on the bottom line and match only the part of the path that's common for all nodes in that section.
    In my case "knowledge/questions".
    Resulting regex: knowledge\/questions\/.+
  4. Create an action: "set breadcrumb trail" and configure it to your liking

This works for my needs in this particular case, but it is not as flexible as custom breadcrumbs.
I would really like to see native breadcrumb support by panels, perhaps using variables from the context, so I'm changing this issue to a feature request.

Blueeeeie’s picture

Hi,

I'm really bad at regular expressions and I was wondering how would you modify your textual comparison condition if I wanted to match URLS like "category/$arg/products" where $arg is actually any taxonomy term.

I tried "category\/.+\/products" but it didn't work so I'm guessing something's wrong with my regular expression.

Would appreciate any help.

regards,
Jamie

sdboyer’s picture

Some kind of native breadcrumb support is an interesting idea, to be sure, but it's definitely not something the Panels devs have time for right now. I'd certainly consider a patch.

Vidarls’s picture

@Blueeeeie:
I don't speak regex fluently either, what I usually do is to test my regex in a regex enabled editor (ie notepad++) using the regular expression function in the search and replace tool to test my regex.
Allso It can be useful to create a workflow-ng rule that prints the [user:url] (or whatever path token you use) as a message to get the raw data you need to apply your regex to.

zach harkey’s picture

The lack of breadcrumb support seems to have something to do with the way panels strips the $title out of the node.

Vidarls’s picture

I've found now that if I display only one node (using node/% override), and select "node page" in the add node content dialog, the custom breadcrumbs module actually works. Custom breadcrumbs is a lot easier to use than the workflow-ng breadcrumb capability.

giorgio79’s picture

What custom breadcrumbs module you refer to?

I user Taxonomy Breadcrumbs and it does not display for me on panels pages...

Vidarls’s picture

The module named "custom breadcrumbs" (http://drupal.org/project/custom_breadcrumbs)

:-D

zach harkey’s picture

Vidar, what do you mean "display only one node (using node/% override)"?

steveoliver’s picture

Thank you for your Workflow-ng approach. It works great! Thanks,

-Steve

aschiwi’s picture

Could someone post a screenshot of the workflow-ng settings Vidar was talking about in comment #2? I seem to be missing something in the settings and I can't get it to work. Also, if i put [user:url] in the top line then i only get user related replacement patterns but that wouldnt make any sense for panel breadcrumbs right?

Vidarls’s picture

Allso It can be useful to create a workflow-ng rule that prints the [user:url] (or whatever path token you use) as a message to get the raw data you need to apply your regex to.

[user:url] is the current active url. Try the tricks mentioned above, choose user is going to view a page as trigger and visit different pages on your site to see how it workss.

aschiwi’s picture

oh man, the thing i was missing was to check the checkbox "Evaluate text2 as a regular expression."

thank you for your help.

remtheory’s picture

Wow, excellent instruction and so helpful. Worked perfectly. Thank you!

remtheory’s picture

Oh I spoke too soon. It worked perfectly as long as I was logged in. I understand now that the logic is that you have to be a user, but it doesn't seem to take hold if the user is anonymous. Can anyone help with that? I couldn't figure it out.

patchak’s picture

I tried to setup what you describe here, (publishing node as a page) on a panel page override, and I still don't see the breadcrumbs...you have done anything else to make it work??

thanks,
Patchak

rc2020’s picture

subscribing

yrre7’s picture

subscribing

Blueeeeie’s picture

The reason why the regular expressions method that Vidar mentioned doesn't work for users that aren't logged in is because the event "user is going to view a page" or "Content is going to be viewed" won't work if page cache is enabled. You'll have to turn page caching off if you want this method to work.. but its not advisable since it affects the performance of your site especially if you're running it in production.

I found another workaround tho...

Just insert a snippet of php code that will run on the page itself to manually set the breadcrumbs link. You can go to http://drupal.org/node/319857 to read more.

Hope this helps.

sun’s picture

Status: Active » Closed (duplicate)