Hi,

I am thinking about this already for a year, but until now no solution yet.

What I would like is to be able to set a different template on a different level of taxonomy.
For example:
-Country
---Region
------Place
Taxonomy levels. With region as child of country and place as child of region.

When you fill in this taxonomy what I would like is that I have the possibility to have a different template which I can select for different taxonomy levels (an possible to have this on admin chosen per vocabulary)
So when you are selecting a different level of taxonomy with for example taxonomy_menu, then a different template is fired to the screen.

I asked this as a feature request to panels 2: http://drupal.org/node/231911, but may be other solutions for this are available
The usage of this will in my perspective boost the possibilities to use Drupal a lot!!

Somebody has drupal examples of this already? Please explain then how you did it.
Thanks a lot in advance!

Greetings,
Martijn

Comments

chlobe’s picture

would be interested in responses to this

summit’s picture

Hi,

Anyone else with the right programming skills want to join in try to get a Hierarchical website rocking with Panels 2?

What I would like is that related to the depth of taxonomy another panel-page-template will show.
Almost the same as the %term panels override, but say you have 3 levels in the taxonomy.
You get a %term/1depth panel-page, a %term/2depth panel page, %term/3depth panel page and %term/4depth panel page
This way going a level deeper in taxonomy gives the possibility to set up sites with hierarchical aspects like:
Country panel page template
--Province panel page template
-----Village panel page template
--------Accomodation panel page template
So the panel page for a country like Nepal will be possible having a complete different lay out than the panel page for Kathmandu.
Thanks in advance for considering this functionality to get panels the hierarchical solution for drupal websites!!

See my post: http://drupal.org/node/231911#comment-847519. As Earl said:
Since the URLs are built through pathauto, all the URLs as far as panels is concerned are taxonomy/term/TID regardless of the depth. Upon loading the taxonomy term, you can load the taxonomy tree and discern the depth of the current term. Once you have this number, you can easily make a determination of which 'display' to use, much the same way that it currently will do for vocabulary.

EDIT:
I try to get this doing from your notes so far:
Remark Earl: Upon loading the taxonomy term, you can load the taxonomy tree
Loading tree:

$depth = 0;
$terms = taxonomy_get_tree($vid, 0, -1. 1);

Remark Earl: Then discern the depth of the current term
Discern depth:

foreach ( $terms as $term ) {  
  $depth = $term->depth;    
}

Question to community: is this the correct code to get the depth of the current term?

The next of the remarks are:
Once you have this number (the depth), you can easily make a determination of which display to use, as is now with panels-2 vocabulary usage.
Question to community: Can anyone help out to get this into code?

Could anybody make some panels 2 code from this? Thanks a lot in advance!
Greetings,
Martijn

esmailzadeh’s picture

i am realy confused
this is a basic requierment that every cms must be response this
i cant belive drupal has not any solution for hierachical website
see category module pages
http://drupal.org/project/category
http://category.greenash.net.au/
it has best solution (if we ignore database redundancy troubles that it makes by wrapping taxonomy and book modules and conflict that it has with views) but this is still full of bugs
http://drupal.org/node/87669
http://drupal.org/node/57821

is there any one can help me?
i am in end of a project and need help for make different template design and node order for each vocabulary.

summit’s picture

Hi,
I now the panels 2 guys are very busy getting panels 2 in RC. Next to that MerlinofChaos is also busy with views 2!
So they are very busy in the moment, but the co-maintainer of panels 2 (Sdboyer)has promissed to look into panels 2 hierarchical templating as stated in: http://drupal.org/node/231911#comment-773334. You could off course ask it also if you need this requirement also.

I know for sure the panels 2 solution will be a great one!

greetings,
Martijn

summit’s picture

Hi,

I am still in the need of a hierarchical menu setup with the possibility to change the first argument behind my base_url to any view/panel of choose.

Directly through panels context would be great but until now unsuccesfull (see above).

Now I am thinking to do this by altering the taxonomy_menu module.
I set up the module here: http://www.wintersport-accommodaties.nl/regionaal/4
I see that taxonomy menu makes url's like [own choosen word]/VID/TID [first level]/TID [second level]

I would like to be able to set different [own choosen words] related to the level I am on.
So:

- if the url is base_url/[own choosen word]/VID -> Top level
- if the url is base_url/[own choosen word]/VID/TID -> Parent term-level, so rewrite to [own choosen second word]/TID [first level]
- if the url is base_url/[own choosen word]/VID/TID/TID -> Child term-level, so rewrite to [own choosen third word]/TID [second level]
-if the url is base_url/[own choosen word]/VID/TID/TID/TID -> Child-child term-level, so rewrite to [own choosen fourth word]/TID [third level]

I do not mind if this is an extra function, or only a snippet, but please help me get this working!

Thanks a lot in advance,
greetings,
Martijn
www.wintersport-accommodaties.nl