Hello i’ve one content material kind with two vocabulary time period references one is known as class and phrases is A,B,C like Drupal Development Company 2nd one assets it incorporates guardian with youngster phrases like under hierarchy
Useful resource 1 Subsection 1 Subsection 2 Subsection 3 Subsection 4 Useful resource 2 Useful resource 3 Useful resource 4
so i wish to show articles primarily based on first taxonomy class then 2nd taxonomy assets associated objects utilizing entity area question under hierarchy
Useful resource 1 Subsection 1 Article 1 Article 2 Subsection 2 Subsection 3 Subsection 4 Useful resource 2 Useful resource 3 Useful resource 4
under is my code for show solely 1st taxonomy primarily based articles fetching however i must show each instances please assist.
<?php $vocab = taxonomy_vocabulary_machine_name_load('resource_category'); $bushes = taxonomy_get_tree($vocab->vid); $array_tree = array(); $array_tree1 = array(); foreach($bushes as $tree) { if($tree->depth == 0) array_push($array_tree,$tree->tid); } $i = 0; foreach($bushes as $tree) { foreach($tree->mother and father as $guardian) { if($guardian != 0) { $array_tree1[$parent][$i]=$tree->tid; $i++; } //~ if(array_search($tree->tid,$array_tree)) //~ array_push($array_tree1,$tree->tid); } } ?> <ul> <?php foreach($bushes as $tree) { if($tree->depth == 0) { echo '<li>'.$tree->title; if(rely($array_tree1[$tree->tid])) echo '<ul>'; foreach($array_tree1[$tree->tid] as $sub) { echo '<li>'.$sub.'</li>'; $query_resources = new EntityFieldQuery(); $query_resources->entityCondition('entity_type', 'node') ->entityCondition('bundle', 'resouces') ->propertyCondition('standing', NODE_PUBLISHED) ->fieldCondition('field_resource_category', 'tid', '21') ->fieldCondition('field_resources_subcategory'); $result_resources = $query_resources->execute(); if (isset($result_resources['node'])) { $news_items_resources = array_keys($result_resources['node']); $news_items_res = entity_load('node', $news_items_resources); //echo '<pre>';print_r($news_items_res); echo '</pre>'; } else { echo '<p><sturdy>No Assets</sturdy></p>'; } } echo '</ul>'; echo '</li>'; } } ?>