5

I have a Book Listing content type and a Series content type. Both of these have a Book Series taxonomy term applied to them. What I want to do is override the Series page with panels and embed a view that will list every book with a matching Book Series tag.

What I've tried is creating a content pane view with a contextual filter of "Content: Book Series", Argument input set to "From context", and Required Context set to "Book Series". I've inserted the view and set the argument to the only one available: "Node being viewed". I've tried everything I could think of including creating contexts and relationships in the panel, creating relationships in the view, etc. I'm at my wit's end here. At the moment I'm relying on a separate view page to show what I want, but it's making the site navigation a pain to deal with. What am I doing wrong here and where can I find a good explanation of contexts?

7
  • I had a similar problem a month or so back and had to postpone solving it. To get the answers I need, I have volunteered to provide documentation for the panels module team and have started getting some answers, although I have not yet gotten the solution to out mutual problem. I can share what I know so far and keep you posted as I work towards the solution.
    – Ashlar
    Commented Dec 15, 2011 at 18:43
  • First, I assume you are using Drupal 7.10 and the latest version of Panels, views and Ctools. Note that the latest rcl in Ctools is nearly six months old, where all the refinements are occurring in the dev version. You may need to install the dev version.
    – Ashlar
    Commented Dec 15, 2011 at 18:45
  • Have you created a custom page panel or are you using one of the default panels provided by Panels to create your variant? (If so, which one?) Could you provide the settings you have for the Page Panel context and the variant context (there are two contexts settings involved and I do not yet know for sure how they relate to each other. ?
    – Ashlar
    Commented Dec 15, 2011 at 18:49
  • I'm using the Node Template. There are no visible settings for the Page Panel Context. Currently I have made no changes to the Variant Context. The Variant Context Summary lists to following:
    – Tsaot
    Commented Dec 15, 2011 at 22:37
  • !context image (image due to length) The item I'm interested in is %node:field_series_tag --> Book Series
    – Tsaot
    Commented Dec 15, 2011 at 22:45

2 Answers 2

4

it depends how you are trying to get the taxonomy term, but here is one solution. In my example I'm using a node as my context, and a taxonomy field of that node as the contextual argument.

There are basically two things you need to get this to work. One, you need to use view panes, so you can get the arguments from the panels context.

How can I show a view in panel with argument in drupal 7

Second, if your trying to get the taxonomy term from a field you need to convert the term to a term id using validation.

Views contextual filters taxonomy name

For instance this would work if you were trying to create a panel that diplayed a node, and a view of content related by a certain taxonomy term that that node belongs to.

0

I just tried to do something similar with View Panes and Panelizer and was pretty confused for awhile.

  1. Go to "Argument Input" and turn that to "No argument". You don't use Panels contexts for any of the next steps and supplying an argument (Such as a Panels context) will override the default value provided by the contextual filter.

  2. Click you contextual filter, select "Provide default value", Type: "Taxonomy term from URL", all of the next three checkboxes, and then select your "Series" taxonomy. The rest is good.

  3. Save it and continue wondering why Panels contexts exist.

1
  • Point 3 - for getting stuff from civi
    – beth
    Commented Mar 22, 2017 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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