Different Panel for each Level of a hirarchical Taxonomy

humanoid's picture
public
group: Panels
humanoid - Wed, 2008-07-09 15:58

Hi,

For a hiking-community offering free maps, I want to create 3 different Panels for the 3 hirarchical taxonomy levels I use to categorize the maps.
- one Panel for the first level taxonomy displaying a specific node (grafical map) for each term, block with child terms, block with node list of promoted maps
- one Panel for the second level taxonomy displaying a specific node (Text for this hiking region) for each term, block with child terms, block with node list of promoted maps
- one Panel for the third level taxonomy displaying a list with all nodes (maps) of this category, block with node list of promoted maps

I played along some time now with views and panels 2 and I love this - yeah, great modules! I created a taxonomy/term/% override panel which lists a view of matching nodes and a block of child taxonomy. But what I can't figure out is: Is it possible to create different panels with views for each hirarchi level of my taxonomy?

For any push in the right dirction I would be very thankful!

best regards
Jürgen Brocke


Hi, I feel what you want. I

MartijnHaan@drupal.org's picture
MartijnHaan@dru... - Wed, 2008-07-09 19:35

Hi,
I feel what you want. I asked a somewhat same feature request: http://drupal.org/node/231911
after getting to know panels 2 better, it would be great to have the possibility to have different panels-"templates" related to depth, exactly as is now possible with different vocabularies, when you use as argument the taxonomy term.

greetings,
Martijn


wow, thanks. You're right.

humanoid's picture
humanoid - Thu, 2008-07-10 07:35

wow, thanks. You're right. We have the same request.
But using different vocabularies will not play together with a hirarchical term navigation block, I guess. I build a navigation block with taxonomy context module which is really nice together with panels & views.

greetings

Jürgen Brocke

brocke.de integrale kommunikation


same request here ...

najibx's picture
najibx - Sun, 2008-08-03 10:39

I am still seeking a solution everywhere ...http://drupal.org/node/237033
Martijn at http://drupal.org/node/231911, is looking for the same. I now realize this is not easily be done eihh.
Not a direct functionality from panel2, but probably from templating ?

-najibx -
Drupal in Malaysia


Hi, I did not found a

humanoid's picture
humanoid - Sun, 2008-08-03 20:02

Hi,

I did not found a solution, but a "workaround" which is fine for me. I used Panels and taxonomy context module for an automatic navigation-block of hirarchical taxonomy. In my taxonmy/term-panel I use a pane displaying the term description, so I'm able to show content depending on each term. You can see a full example here: http://www.egotrek.de/wanderregionen/nordrhein-westfalen (click to subterm "eifel" which hase full example content).

Jürgen Brocke

brocke.de integrale kommunikation


Jurgen, Nice site! Could

Doktor-Science - Mon, 2008-08-04 17:19

Jurgen,

Nice site! Could you explain a little more about how you built your site using Panels and the other modules you chose?

Hey there, of course I can

humanoid's picture
humanoid - Tue, 2008-08-05 10:32

Hey there, of course I can give some more details:

I use a taxonomy with 3 levels:

Province
-Touristic-Area
--Hiking Area

To select taxonomy from anode, I use the module hierarchical_select.

I use Panels 2 and created one Panel which overrides taxonomy/term view. As context I use the Term-ID.
The Panel has 3 rows and a sidebar.
1st row contains the taxonomy term description of the actual term
2nd row contains a view of the highlighted (promote to frontpage) of the actual term (highlight-view)
3rd row contains a list of all nodes of the actual term (Node-list)

Views:
1) highlight-view is a list-view of the node-titles and Intro-text (which is a separated cck-field of the node) and VotingAPI percent vote result (FiveStar-Stars as Handler).
2) Node-list is a standard table view (taxonomy/term) of the node-titles and the filed VotingAPI percent vote result (FiveStar-Stars as Handler).

The term navigation block is provided by taxonomy_context module. I used this patch to show only terms which have nodes assigned to

The detail page of a hiking side contains various CCK-Fields for pasting source-code like the extern interactive map and also the downloads because they are tracked by a extern system
Modules I use to create the detail view of a hiking side:
CCK with CCK Fieldgroup Tabs to group content to tabs
FiveStar Rating

For product (maps and software) purchase by downloads, I use Ubercard shop with paypal-payment.
Node Reference to reference from an ubercard-article back to the node

If some people are interested, I can create a screen cast, showing the different settings.

Best regards
Jürgen


Thanks! A screencast would

Doktor-Science - Wed, 2008-08-06 17:53

Thanks! A screencast would be great!

Hi, thanks for your

humanoid's picture
humanoid - Thu, 2008-08-07 21:22

Hi, thanks for your feedback! I will create a Screencast within the next week.

Best regards
Jürgen


…this is exactly what I

tille@drupal.org - Mon, 2008-08-11 17:26

…this is exactly what I was looking for - for quite a while: a taxonomy override! …and especially one for an hierarchical taxonomy tree. Hurray! Almost cant wait to see it…! :]
I actually even find it a bit strange, that there seems to be not so much interest in this topic from other drupalists - no tutorials, no how-to's - and I find it actually one of the most crucial little details… - …how could one actually even think of building another website without tree-taxonomy-override-panel…? …:]

Anyways: a screencast would be a blast!! …a few hints and tipps and details would probably also already be very very useful!

I actually tried to figure out how to do this myself - first I had some difficulties figuring out how/where/what to do, then I had the feeling that I could see some light at the end of the tunnel… - …but I am still not sure if that's the rising sun or a train coming y way…
I followed this tutorial "Panels 2: Create a node override" and tried to apply your hints…
http://drupal.org/node/206185
…well - anyways.

Now I am looking forward very much to finally get to understand panels2 a bit more - and finally have an option to override taxo-layouts…:]

…well - what can I say…? …I'm quite excited - but you probably guessed that already…:]

Just let me know it there's anything I could do to help - even promoting some egotrekkings would be perfectly fine for me…:]

greetings, till…

just a workaround

humanoid's picture
humanoid - Tue, 2008-08-12 07:14

Hi till,

don't expect to much. I hav'nt found a solution for panels depends on the hierarchie of the taxonomy. I just used one panel which is the taxonomy override as it is described in the tutorial http://drupal.org/node/206185
But I'm also using taxonomy context module which supplies a nice hierarchical navigation.
I will show you more details soon...
BTW, does anybody know a good screecast software fpr windows? I use Jing some time but it is limited to 5 minutes....

greetings
Jürgen


well - it works!

tille@drupal.org - Tue, 2008-08-12 07:26

…after cooling down I had a closer look at all factors involved - and finally found what I did wrong: the view argument was still set to "taxonomy term" and not "taxonomy id" - so there was nothing actually wrong on the panels side - just the view didn't understand the info the panel was sending … - …great.

@Jürgen: thank you very very much! …without your beautiful hiking pages as an example that this really works I probably wouldn't even have tried this…!

greetz, t..

PS: …should somebody still write this 'taxonomy-panels-overwrite' down on a step-by-step basis for the panels tutorial page …(http://drupal.org/node/201915)…? …of course a screencast would still be probably the ultimate help for people trying this 'trick'…:]

Anyone up for a plug in?

MartijnHaan@drupal.org's picture
MartijnHaan@dru... - Thu, 2008-08-14 14:26

Hi,
Humanoid, it works, but I do not think you use different panels-pages on the different levels, right?
I have a somewhat same installation on www.trekking-world.com, but would love to be able to set a different panel-page for a different depth of taxonomy (would be awesome also to be able to set different panel-pages per vocabulary per depth..but may be to much to ask).

greetings,
martijn


Hi Martijn, yes you are

humanoid's picture
humanoid - Thu, 2008-08-14 15:02

Hi Martijn,

yes you are right. I did it like you. There is no solution for using different panel pages depending on the term hierarchy I know so far.
best regards
Jürgen


questions arising..

tille@drupal.org - Wed, 2008-10-08 16:56

hello again,

the past days/weeks I worked with this this 'taxonomy-panels-overwrite' - and i am very happy with it. I currently use it for my tour dates database where I basically would want to use different hierarchical vocavularies - currently I only use one 3-level-taxonomy, one 2-level-taxo and one 1-level-tax...

this is the page:
http://www.livetourdates.org/

  • "gig location" is a 3-level-taxonomy
  • "festivals" is a 2-level-taxonomy
  • "artists" is a 1-level-taxonomy

Now that everything is fine new demands arise - and I think/hope they might be interesting for others too.. First I found out, that parallel to the 1-level-panel I can use a view to list some "archive":

1) "/artists/name" is the panels-page for a specific artist
...generated from the url "taxonomy/term/tid" -> panel overwrite..
...example: http://www.livetourdates.org/artists/Madonna

2) "/artists/name/past-gigs" is a view for the same artist listing his/her past gigs..
...generated from a view with url "$arg/past-gigs" -> argument is term id
...example: http://www.livetourdates.org/artists/Madonna/past-gigs

..works phantastic..

The 'problem' this ONLY seems to work for 1-level-taxonomies. I tried to achieve the same effect with the other taxos/panels but could not get one 'archive' page working.. I also tried to use the same overwrite with a second panel using the url "taxonomy/term/%/past-gigs" - which in my opinion would be the 'cleanest' way to do such things - but that also does not work.

example:
this is what I would want:
"/country/city/venue/past-gigs"

Now my question: does anybody here know a way to generate such 'sub-views' or 'sub-panels' for an existing panel..? ..I think the example above is already quite a 'typical' one - and I could easily think of dozends if not hundrets of other uses where it would make sense to 'expand' a panel with such 'sub-views' or 'sub-panels'..

well - lookind forward for any thoughts and/or pointers..:]

greetz, tille..

PS: the archive-view actually currently also 'affects' the 3-level-txo - but only like this:

"/country/past-gigs"
"/city/past-gigs"
"/venue/past-gigs"

here's the links to the 'real' example pages:

http://www.livetourdates.org/Norway/past-gigs
http://www.livetourdates.org/Trondheim/past-gigs
http://www.livetourdates.org/Marinen/past-gigs

and instead I would love to see this:
http://www.livetourdates.org/Norway/Trondheim/Marinen/past-gigs

...hmmm...

updated 07.09.2008
just for those wondering why at the above address there actually now is a working 'archive page' - I now actually can use the desired path for that purpose
http://www.livetourdates.org/Norway/Trondheim/Marinen/past-gigs
but it's a rather dirty workaround: I 'simply' add a new page for the venue (in this case "Marinen") and for the archive listing I then use a view-in-the-page-snippet.. this does actually give me the desired archive page, but only if I manually add a new page for every venue that resides in the database. currently there is almost 1000 venues - so that road probably won't get me there - but for now it works..:]

Hi Humanoid, Great you are

Summit@drupal.org - Thu, 2008-09-04 09:11

Hi Humanoid,

Great you are working with this. Still think you are building a work-around.

I still think it would be absolutely great to have a Panels depth context possibility.
As explained by Earl on:
http://drupal.org/node/231911#comment-762498 and
http://drupal.org/node/231911#comment-763215
he thinks it is not very hard to do, but until know I am not successfull in this.
May be we can join efforts and ask a pro-drupal to contruct it if possible?

Although great Sam says it is to early for it on:
http://drupal.org/node/231911#comment-920499 and
http://drupal.org/node/231911#comment-922211

But I would very much like to have this depth option as context, so you can build different panels-page templates on different taxonomy depth level, that would be awesome! Right?
I am wanting this so long already.. see thread starting date..

greetings,
Martijn

Yes Martijn, you are right.

humanoid's picture
humanoid - Fri, 2008-09-05 18:13

Yes Martijn, you are right. My solution is only a work around. I'm following the dissussions about that Panels depth context possibility but it seems to me more difficult so I don't expect a solution within short time. I'm also to busy at the very moment to really get into that.
But I will be back soon with some more details because I have to develop some more views with my solution and I will get more expierence with that till end of the month.

Jürgen Brocke

brocke.de integrale kommunikation


great topic

robertgarrigos's picture
robertgarrigos - Sun, 2008-09-14 08:28

I'm looking for something similar, so I'm just subscribing for now.

Robert Garrigós
Professional site: garrigos.cat


Hi Guys,May be this snippet

MartijnHaan@drupal.org's picture
MartijnHaan@dru... - Sat, 2008-09-20 19:27

Hi Guys,

May be this snippet is usefull.
What I would like is to have this snippet changed, so on different term-depth different "templates" are possible, as in the snippet the "tag" template should be possible.
Source snippet: http://drupal.org/node/72601

<?php
function custom_url_rewrite($type, $path, $original) {
 
$newpath = $path;

 
// This path was already aliased, skip rewriting it
 
if ($path != $original) {
    return
$path;
  }

// Restore from custom url:
 
elseif ($type == 'source') {
    if (
substr($path, 0, strlen("tag/")) == "tag/") {
     
$termid = substr(strrchr($path, "."), 1);
     
$newpath = "taxonomy/term/".$termid;
    }
  }

// Rewrite to custom url:
 
elseif ($type == 'alias') {
    if (
substr($path, 0, strlen("taxonomy/term/")) == "taxonomy/term/") {
     
$termid = substr($path, strlen("taxonomy/term/"));
     
$termname = taxonomy_get_term($termid);
     
$newpath = "tag/".$termname->name.".".$termid."/";
    }
  }

// Nothing to do:
 
return $newpath;
}
?>

2 things need to be done:
1- first the url's needs to be escaped to prevent dangerous attacks. I am not enough programmer to exactly know what is meant with this?
2- the depth of terms logic to have different templates on different term-depths need to be added.
Off course this is still a work-around, while having term-depth as context like nodeID would be absolutely asume!

EDIT: I got it working with taxonomy_menu and a small altered version of above snippet with the answers of both questions found on drupal.org and thanks to Thomas Narres
Will post my findings if I have the time again.

How are you proceeding Humanoid, may be your version is better..?

greetings,
Martijn

Greetings,
Martijn