I want to display a node's taxonomy terms as a list (nd currently only has formatters to display them next to each other).

Would this be something you would consider including in nd? If so, I'll start a patch.

Comments

swentel’s picture

Very interested, even for D7 :)

brunodbo’s picture

Status: Active » Needs review
StatusFileSize
new2.45 KB

Following your approach for the other taxonomy term formatters (jeuj for copy/paste :)), this patch ...

1) Adds two new formatters to nd_ds_fields():

'nd_terms_per_vocabulary_list' => t('Unordered list'),
'nd_terms_per_vocabulary_linked_list' => t('Unordered list, linked to term'),

2) Passes these formatters in nd_theme() to nd_terms_per_vocabulary().

3) In nd_terms_per_vocabulary(), checks for the new formatters and outputs $terms as a list if $list is set.

brunodbo’s picture

Version: 6.x-2.x-dev » 6.x-2.4
StatusFileSize
new1.75 KB

Some irrelevant stuff in previous patch. Here's a new one.

Status: Needs review » Needs work

The last submitted patch, ndtermsaslist-1141524-3.patch, failed testing.

brunodbo’s picture

Status: Needs work » Needs review

Hmm, not sure why testing fails, patch applies cleanly locally.

dave reid’s picture

Version: 6.x-2.4 » 6.x-2.x-dev

Trying against a branch rather than tag...

dave reid’s picture

#3: ndtermsaslist-1141524-3.patch queued for re-testing.

brunodbo’s picture

Version: 6.x-2.4 » 6.x-2.x-dev

Shouldn't the re-test have run by now?

brunodbo’s picture

StatusFileSize
new1.75 KB

Uploading it again, to re-send it to testbot.

swentel’s picture

Project: Node displays » Display Suite
Version: 6.x-2.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

Committed and pushed, thanks! IIRC I guess the test bot has troubles with dependency projects no ?
Moving to DS to see if I can reuse some of this stuff for taxonomy formatters in D7.

swentel’s picture

Status: Patch (to be ported) » Closed (won't fix)

Marking this as won't fix, the field template option now has this option.

vasike’s picture

Category: feature » support
Status: Closed (won't fix) » Active

how does it works, as i can't this find this formatter for term reference.
What about having a comma separated terms.

heyyo’s picture

Formatter for term reference works great to make an ordered list or unordered list but how could I add rel="tag" on the anchor HTML tag ?

swentel’s picture

Status: Active » Closed (fixed)

Going to add comma separated stuff in #1276966: View modes for taxonomy terms are inconsistently available for ds_field_formatter_info().

Edit: this already works with the expert field template. Extra attributes will be added soon.

botris’s picture

StatusFileSize
new67.27 KB

I've attached a screenshot of settings on how to achieve this.
List settings for expert field settings