1

I'd like to put several hand-picked taxonomy terms on a panels page, each term as a panels pane, showing their descriptions, with a more link to the term's view page, and maybe some of the fields that I have added. Is there any module to do this?

Right now for each term I have to create a page, panelize it, add a view pane of the term to it, and then add the page to the panels I want them to show up. Seems to be working nicely enough but still too troublesome for ordinary editors to do it themselves.

  • 1
    I you want to clarify your question it would be better if you would edit it :) – Potney Switters Oct 4 '13 at 10:48
  • I'm not sure if I understand exactly what you want to do, but perhaps a mini-panel, taking a taxonomy argument, would give you a re-usable component solving your problem? – Letharion Oct 4 '13 at 11:06
  • It might. Off to try it now. – Pomin Wu Oct 4 '13 at 11:15
  • Hmm. Not sure how to create a mini-panel that takes an argument. If I add a required context, the mini-panel just won't show up in the "Add Content" dialogue. – Pomin Wu Oct 4 '13 at 13:03
  • Then the required context isn't available. :) What is the source of the terms? You need to add the term, either manually, a single term directly to the page, or map a url argument. – Letharion Oct 4 '13 at 14:34
1
  1. Create a Page
  2. Give it a %term argument and map it to a taxonomy term
  3. Create a view pane that takes a taxonomy term as argument.
  4. Create a mini panel that requires a taxonomy term argument.
  5. Add the View to the mini panel. Configure it to use the taxonomy term.
  6. Add the mini panel to the Page.
-1

Are you confortable with custom coading?..If so here is an approach that might be friendly:

  1. Create a Select field with simple yes/no option, to taxonomy term vocab (whose terms you want to be displayed in panels pane). lets call this "field_check". For each terms you want to be placed in panels, you will select yes, others will default to no.

  2. In a custom module implement hook_block, to generate a block for all terms, which have the above field checked.

for example:

/**
 * Implements hook_block_info().
 */
function mymodule_block_info() {
  $blocks = array();
  $vocab = taxonomy_vocabulary_machine_name_load('vocab_name');
  $vid = $vocab->vid;
  //get the taxonomy terms by vocab id
  $terms_array = taxonomy_get_tree($vid);
  foreach ($terms_array as $key => $voc) {
    if($voc->field_check['und'][0][value] == 'yes') {
      $blocks['term:' . $voc->tid]['info'] = $voc->name;
    }
  }
}

Also implement a corresponding hook_block_view().

  1. This will create a separate block for each term you have chosen to be exposable to be added to panels. Now your content editor can just go in and add the blocks to the panels as panes.

  2. Please remember the output will depend on the implementation of hook_block_view corresponding to each term you have exposed.

Hope this helps.

  • "separate block for each term" which is one of the reasons to absolutely not use blocks. – Letharion Oct 4 '13 at 14:34

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.