Panel pages and breadcrumbs

Vidar Løvbrekke... - June 23, 2008 - 22:00
Project:Panels
Version:5.x-2.0-beta5
Component:Panel pages
Category:feature request
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

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

#1

ramriot - June 24, 2008 - 21:16

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.

#2

Vidar Løvbrekke... - June 26, 2008 - 19:04
Category:support request» feature request

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.

#3

Blueeeeie - July 9, 2008 - 05:49

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

#4

sdboyer - July 12, 2008 - 16:57

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.

#5

Vidar Løvbrekke... - July 14, 2008 - 21:57

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

#6

Zach Harkey - July 23, 2008 - 18:22

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

#7

Vidar Løvbrekke... - July 23, 2008 - 20:10

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.

#8

giorgio79 - July 26, 2008 - 10:04

What custom breadcrumbs module you refer to?

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

#9

Vidar Løvbrekke... - July 28, 2008 - 22:19

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

:-D

#10

Zach Harkey - July 29, 2008 - 03:20

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

#11

steveoliver - August 20, 2008 - 20:45

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

-Steve

#12

aschiwi - August 25, 2008 - 14:44

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?

#13

Vidar Løvbrekke... - August 25, 2008 - 20:35

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.

#14

aschiwi - August 26, 2008 - 08:43

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

thank you for your help.

#15

remtheory - September 2, 2008 - 20:07

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

#16

remtheory - September 2, 2008 - 20:24

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.

#17

patchak - September 8, 2008 - 17:54

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

#18

corona ronin - November 7, 2008 - 20:56

subscribing

#19

yrre7 - November 21, 2008 - 23:18

subscribing

#20

Blueeeeie - December 2, 2008 - 09:34

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.

#21

sun - December 28, 2008 - 15:44
 
 

Drupal is a registered trademark of Dries Buytaert.