Download & Extend

Taxonomy terms should display inline

Project:Drupal core
Version:7.x-dev
Component:taxonomy.module
Category:bug report
Priority:normal
Assigned:rontec76
Status:closed (duplicate)
Issue tags:CSS, field items, inline

Issue Summary

I think the title says it all. Just for clarification see the attached screenshot.

AttachmentSizeStatusTest resultOperations
screenshot_01.jpg220.49 KBIgnored: Check issue status.NoneNone

Comments

#1

Assigned to:Anonymous» rontec76

#2

Yeah, this is one of the most annoying things in d7. These terms should be in a list, not just a bunch of divs.

#3

@rontec76 - you got a patch coming for this one? Be good to resolve this.

@Jacine - we could make them lists, what you think? It does mean adding the suggestions - but I've been thinking about coming in with a late breaking patch for D7 to add suggestions per field-type to make this a hell of lot easier. I've been using...

<?php
function themename_preprocess_field(&$vars, $hook) {
 
// Add specific suggestions that can override the default implementation.
 
array_unshift($vars['theme_hook_suggestions'], 'field__' . $vars['element']['#field_type']);
}
?>

#4

@Jeff I think suggestions are a great idea. If you post up an issue let me know and I'll chime in to support.

Either way, we should definitely make this a list IMO.

#5

OK, I posted an issue - lets see how this fly's #784792: Field Type Template Suggestions

#6

oh btw, I'm doing with this with Bartik on local host already - applying the patch from the above issue and using this in template.php

<?php
function bartik_field__taxonomy_term_reference($vars) {
 
$output = '';

 
// Render the label, if it's not hidden.
 
if (!$vars['label_hidden']) {
   
$output .= '<h3>' . $vars['label'] . '</h3>';
  }

 
// Render the items.
 
$output .= '<ul class="taxonomy-list">';
  foreach (
$vars['items'] as $delta => $item) {
   
$output .= '<li>' . drupal_render($item) . '</li>';
  }
 
$output .= '</ul>';

 
// Render the top-level DIV.
 
$output = '<div class="terms clearfix">' . $output . '</div>';

  return
$output;
}
?>

#7

I'm all for overridding core output to make these be the

  • they should be. In whatever way we can.
  • #8

    Don't reinvent the wheel -- use http://api.drupal.org/api/function/theme_links/7

    #9

    Umm, so your saying using theme_field to theme a field rather than theme_links is reinventing the wheel?

    Say wha?

    #10

    In that theme_links makes you a UL of inline links.

    #11

    OK, I see, but really the issue cuts deeper than just a UL - its about using any markup we want in whatever field type. BTW sorry if I sounded a bit rude (now I read again) I wasn't meaning to.

    #12

    Project:Bartik» Drupal core
    Version:7.x-1.x-dev» 7.x-dev
    Component:User interface» taxonomy.module
    Category:task» bug report

    :D

    Hmmm they're a long list on Garland too.

    I think we should move this to core, and fix it in either taxonomy module or FieldAPI rather than every theme having to do the same work.

    #13

    Should we mark this as a duplicate of #784792: Field Type Template Suggestions

    #14

    Status:active» closed (duplicate)

    Looks like, yes

    #15

    OK, I'll mark this as duplicate of #784792: Field Type Template Suggestions since the other issue is really questioning this for core.

    Just to clarify something that has not been stated - if you do want field items inline you can select this in the Display Options for the field. However this is about HTML, the display options merely change the display using CSS.

    #16

    Thanks for the hint on the bartik function ... works great. Now terms are an ul list as they should be :)

    nobody click here