I'm planning a site with two navigations:
first navigation: - term1 of vocabulary1 - term1 of vocabulary2 - term2 of vocabulary2 - term2 of vocabulary1 - term1 of vocabulary2 - term2 of vocabulary2
second navigation: - vocabulary2 - term1 of vocabulary2 - term2 of vocabulary2
The parent terms of the navigation will simply point to the taxonomy term (taxonomy/term/id), the child terms to the corresponding view (if there's a better solution, how to achieve such a navigation structure, please let me know).
Is there a module or any code snippet to hide navigation items if the corresponing taxonomy term or view doesn't have any nodes assigned? I searched but couldn't find any.
Thanks. Richard
Seitenweberei.ch ha scritto:
Is there a module or any code snippet to hide navigation items if the corresponing taxonomy term or view doesn't have any nodes assigned? I searched but couldn't find any.
One solution may be to test if there are nodes for the termX and after display it. (This code is writing without test and only via memory) <? if (db_result(db_query("select nid from node where tid = %d limit 0,1",{here the tid of termX})) == 1) { echo "termX of vocabolary Y"; } ?>
Ok, the code is not well performant, but it is a start.
M.