Create display of taxonomy terms with depth in Panels

Events happening in the community are now at Drupal community events on www.drupal.org.
plousia's picture

Hi folks, I'm sure this is a newbie question with probably a simple answer, but I haven't been able to figure it out.

What I want to do is have a Panel display all of the nodes tagged with a particular taxonomy term OR its children. In the panel, I have a context which is the parent term. The view has a Taxonomy: Term ID with depth argument. In the panel it's converted to the Taxonomy: Term ID context.

However, the panel will only display any nodes tagged with the top taxonomy term, not any of the children. I've tried several different things to solve this but none of them worked. I guess I could add contexts for each of the child terms to the panel, but I'm sure there must be an easier way.

Is it a custom argument I have to create in Panels? If so, how? or am I missing something really simple...

Thanks in advance.

Comments

Two-step solution

itangalo's picture

When I did something similar the other day, I ended up with the following configuration:

  1. A panel page (using Page Manager), overriding the standard taxonomy list page
  2. A view listing nodes. As argument I used 'Taxonomy term ID with depth', and chose the depth as '10' – meaning that it should match all parent terms to the tenth level.
  3. Adding a Content Pane display for the view (using the View Content Panes module – also in CTools), and setting argument input as 'Term ID' (or, if you like, multiple term IDs separated by + or ,).
  4. In the panel page, I added a context using relationship 'term parent', and set it to select the top level parent of the active term.
  5. In the panel page, I added the views content pane, sending the top level term ID to views as the argument.

Quite many steps, and quite abstract. Sorry about that.

If you want to dig deeper: Try to find a way to avoid the 'depth 10' in the argument settings, since this causes a quite nasty database query.
If you want a much easier but less flexible solution: Use the standard taxonomy list page, but add a '/all' at the end of the path – like taxonomy/term/1/all. This will give you a list of all nodes with this term, or any of its child terms (but not displayed in Views or Panels).

Good luck!
//Johan Falk, NodeOne, Sweden

Thanks!

plousia's picture

Fantastic, thanks. That sounds like it should work well--I will try it out when I have time.

Thanks for your time to answer.

Panels

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: