Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Using s standard theming function to create a list is better design.
Patch attached but diff has gone a bit mental with the braces so it's not as clear to the eye as it could be.
Basically I am replacing the whole of theme_term_display_list() with the following.
/**
* Theme terms as a list.
*/
function theme_term_display_list($vocabulary, $terms) {
foreach($terms as $term) {
$term_links[] = l($term->name, taxonomy_term_path($term));
}
return theme('item_list', $term_links, check_plain($vocabulary->name));
}
Comment | File | Size | Author |
---|---|---|---|
term_display-theme_item_list.patch | 846 bytes | joachim |
Comments
Comment #1
nedjoAgreed that we shd use the standard functions where possible. In this case I didn't because I wanted to have this list themable by adding special classes. We could use the $options argument to feed a class to l() though:
Comment #2
joachim CreditAttribution: joachim commentedOr set the class on the UL -- gives you more styling options. If you need to style the LIs, use CSS selectors.
Comment #3
nedjoSounds good, pls go ahead and commit that change.
Comment #4
NikLP CreditAttribution: NikLP commentedNedjo - will you be able to port/commit these changes to the D6 branch or do you want some assistance?
I guess in most instances the port will be relatively trivial?
Comment #5
nedjoGood point.
Yes, the patch needs to be applied first to HEAD (from which the D6 releases are done) and then to the DRUPAL-5 branch.
I don't think this part of the code changed with the upgrade to 6, so the same patch shd apply.
Comment #6
joachim CreditAttribution: joachim commentedCommitted to both HEAD and DRUPAL-5 branches.