Hi all,
I used FAQ module to list all question with taxonomy term. Here is example of how my Faq page listed
FAQ vocabulary
-> Taxonomy Term 1
-> child Taxonomy Term 1
-> node content
-> child Taxonomy Term 2
-> node content
-> Taxonomy Term 2
-> child Taxonomy Term 3
But, I want to dispaly child Taxonomy terms based on Taxonomy Term 1 value (as an argument). I constructed custom menu callback and copy the faq_page() function from faq.module and i just include the $term->parents[0] == $tid in If condition. For example:
Menu call back:
$items['faq-term/%'] = array(
'title' => 'Frequently Asked Questions',
'page callback' => 'faq_page_custom',
'page arguments' => array(1),
'access callback' => 'user_access',
'access arguments' => array('view faq page'),
'weight' => 1,
'type' => MENU_SUGGESTED_ITEM,
);
custom Function:
function faq_page_custom($tid = 0, $faq_display = '', $category_display = '') {
...........
............
case 'hide_qa':
case 'categories_inline':
if (faq_taxonomy_term_count_nodes($term->tid) && $term->parents[0] == $tid) {
_display_faq_by_category($faq_display, $category_display, $term, 1, $output, $output_answers);
}
break;
........................
..................
}
Please Suggest me if it is correct.
Thanks,
A. Jaffar ali
Comments
Comment #1
jaffaralia commentedHi all,
I achieved this by using views. I created custom views with following configuration.
1) Create custom page views
2) In fields i enabled tile, content and taxonomy term name
3) In Filters i added taxonomy term: parent term
4) In Relationship i added Content: Taxonomy terms on node
5) For Accordion effect i download and enabled views accordion module (Refer: http://drupal.org/project/views_accordion)
6) Select Format: Views Accordion, configure Grouping field Nr.1 : taxonomy term: name and click save
FAQ module now integrates with Views and a few basic Views layouts have been provided. If you have additional Views layouts you'd like to add to this in default list
Thanks,
A. Jaffar ali