Hey there!

Great work on this module, love it.

I apologize in advance if this has been covered in this forum already; I did some searching but kept feeling like I might have been using the right search terms. I hope I explain this adequately.

Anyway, the way this module displays terms and their lineage during the node editing portion is wonderful. The problem is that I want to recreate this display when viewing content -- not just when editing it. For example, the module will allow me to select the tags hierarchically as:

BMW›7 series›714i

But then, upon display of the node, that hierarchy appears to be lost and the associated terms are just listed.

Is accomplishing that possible, either at the module level or the theming level?

Any help would be appreciated.

Thanks!

Andrew

Comments

wim leers’s picture

Component: Miscellaneous » Code
Assigned: Unassigned » wim leers
Category: support » task
Priority: Normal » Minor

Marked #424358: dropbox also show in view-perspective as a duplicate of this issue.

This is possible through the theming layer. I'll provide a theming function that does this and document it.

Andrew Kaufmann’s picture

Beautiful. Thanks!

wim leers’s picture

Status: Active » Needs review
StatusFileSize
new5.61 KB

Andrew Kaufmann — and actually his employer, Southern Methodist University — is sponsoring this patch! :)

And here it is already, awaiting Andrew's review.

aelling’s picture

The patch works nicely, however, is there a way to make the taxonomy links that are printed out from the function linkable to their taxonomy term page? That would be a nice enhancement.

wim leers’s picture

Unfortunately, it is impossible to do that in a generic way. I'm not yet feeding "linking metadata" into Hierarchical Select in a generic way via its hooks. That could (and should) be a future feature. I've created an issue for it: #539156: Optional hook: hook_hierarchical_select_item_link().

For now, this can be achieved by overriding the theme function I've provided. I've attached such an override for you. The instructions are included in the file.

I've also updated the patch because I noticed a bug in the sample code in the README. The actual code is unchanged, so you don't have to apply the new patch to test this.

aelling’s picture

Thanks Wim for the example theme function, it works well and is a lot cleaner using the l() than the way I had it originally coded.

Andrew Kaufmann’s picture

Great job, Wim... it's greatly appreciated, and this is fantastic! Thank you so much for your time :)

wim leers’s picture

Title: Displaying taxonomy lineage » Theme function to display lineages when viewing nodes
Status: Needs review » Fixed
StatusFileSize
new5.04 KB

Since you're satisfied, I've ported the patch to the Drupal 5 version of HS (see the attached patch). I've also committed it:
- D6: http://drupal.org/cvs?commit=247000
- D5: http://drupal.org/cvs?commit=247002

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

phelix’s picture

I have drupal 6 and need a way to display the items that have been selected. I used thist module to display State and then regions. And on the user profile template I need to display the State and the region. Will this patch fix this? I can't seem to get it to work properly.

ordually’s picture

I had been stumped on this too, but additional changes (beyond what is discussed in this ticket) are needed in your theme. The author has kindly documented them very well in the HS README.txt file...have a look at the section titled "Rendering hierarchy lineages when viewing content".

Cheers,
Ord