1

I have a Panel Page, which displays several View Panes. I have specified a term name as an argument in the path settings. This is used to filter the View Panes.

When I use an optional argument everything works fine - clinical-role/!role_name. But when I change to a required argument clinical-role/%role_name then I get page not found when visiting /clinical-role and when visiting /clinical-role/early-skills-for-non-training-grade-doctors

I need the argument to be required because I don't want the panel to display when people visit /clinical-role.

Here is an export of the Panel Page: http://pastebin.com/ASmFnVU5

Here are my argument settings:

enter image description here enter image description here

And also my context settings:

enter image description here

  • 1
    You could try having an optional argument and then in the selection rules add something like "taxonomy term is not empty" – Pontus Nilsson Jul 16 '14 at 13:42
  • 1
    Are you absolutely sure that things work correctly if the argument is optional? It's not just that the panes happen to be working anyway? I can't think of a reason it would stop working because an argument changed from optional to required, as long as the argument was there in the first place. Try creating a blank text pane and output the argument token in it for debugging, I would expect this to fail even when the argument is conditional, which points to something being wrong in the argument setup. @PontusNilsson's suggestion sounds like a nice workaround though. :) – Letharion Jul 16 '14 at 13:47
  • You're right, I added the term name to a text pane and nothing appears! I've added my argument and context settings to the question, do they seem correct? I'm quite new to panels ... – littledynamo Jul 16 '14 at 16:10
  • I think the problem is that my term has a hyphen in it - "Early skills for non-training grade doctors". When I use a term that has no hyphen then the term name appears in my text pane. Must be related to the "transform dashes" option in views. – littledynamo Jul 17 '14 at 9:33
  • Yep - drupal.org/node/672606 – littledynamo Jul 17 '14 at 9:53
1

The problem was that my taxonomy terms had dashes, e.g. "Early skills for non-training grade doctors". When used in conjunction with views contextual filters and the option to "Transform spaces to dashes in URL", it doesn't match properly, so no value for the context is provided. This is related to the following views bug - https://www.drupal.org/node/672606 (no solution as yet for panels but there is a solution if you're just using a view page in comment #16). My solution was to remove all dashes from my term names. Not ideal but fixes the problem.

Here is how I set things up to pull a taxonomy term name contextual filter into a View Pane, in case it helps someone. If anyone knows a better way to go about this then please let me know and I will update this answer:

View Setup - Contextual Filter

Contextual Filter:

enter image description here

View Setup - Argument Input

This part is counter intuitive, you have to choose "No argument input". Providing a context from panels will prevent the default filter value from being used. Thanks to the following comment for helping me figure this out: Views contextual filters taxonomy name

enter image description here

enter image description here

Panel Setup

N.b you have to use a panel page here (structure > pages), so that you can make use of the wildcard feature. I tried this by panelizing a node initially but couldn't get it to work.

Basic settings:

enter image description here

Argument settings:

enter image description here enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.