6

I'm using Panels to override the taxonomy display at taxonomy/term. I just enabled the term_view page that comes with Panels and it works great.

So going to mysite/colours/blue shows the Panels page no problem.

Now I want to add a View to the panel that lists the returned nodes. I create the view, and add a relationship 'Content: taxonomy terms on node' (selecting the required vocabulary 'colours').

The I add an argument (contextual filter) on 'Taxonomy term: name'. This works great in the view preview if I enter the value 'blue' but not if I enter 'colours/blue' (no results). And it doesn't work in the panel because 'colours/blue' are the arguments being passed to it.

How do I get the view argument to work with this URL?

  • +1 This will save me a lot of work by just supplying an argument for different output based on the same View. Thanks. – therobyouknow Mar 28 '12 at 12:11
5

In the Views UI, each Content Pane has "argument settings". In there you have, at least, two options.

  1. The easiest to configure, is "From panel argument", and its option in this case, "Second argument". This works fine in your situation.
  2. The most flexible, that I always use, require more understanding of the Ctools context.
    1. The argument setting then is "From context" and in this case "Taxonomy Term" -> "Name".
    2. Save the View, go into the Panels UI, add the View Pane, not just a View.
    3. Assuming your Panel Page now has a taxonomy term, which is always the case on the /taxonomy/term page, you will get a dropdown, most of the time with just one option, that lists the available terms that you pass on to the View.

If you for example had a path like /color/red/blue, because you wanted two terms, the second version will allow the re-use of the same View on the same page, with different content.

  • +1 This will save me a lot of work by just supplying an argument for different output based on the same View. Thanks. – therobyouknow Mar 28 '12 at 12:11
  • @Letharion what do you exactly mean 'From panel argument'? The terminology is not really straightforward for me(my bad I know), but could you please be more specific? :) – Potney Switters May 15 '13 at 14:42
  • "From panel argument" must be read in the context of the sentence before point 1. Does that make sense? Otherwise I don't know what you're asking. – Letharion May 16 '13 at 22:35

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.