Project:Link
Version:6.x-2.9
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Currently, the help text is only displayed below the URL textfield. This tends to look weird when the URL and Title textfields are side-by-side...

I recommend either having two separate help texts (one for each textfield), or placing the help text below both textfields so it spans them both.

I couldn't work out how to do this myself, so no patch sorry.

Comments

#1

This seems to be bound into the nature of a cck field. I'm going to look into it further later, but it's not a simple fix off of the top of my head.

#2

I got around this by overriding the theme_link() function in my theme.
I simply manually set the description and unset it from the URL form element array.
The only short coming that I can see is that if somebody had to override theme_form_element() and changed the description style this would have no affect on link field descriptions and there is now some extra space between the form fields and the description.

<?php

/**
* FAPI theme for an individual text elements.
*/
function theme_name_link($element) {
 
drupal_add_css(drupal_get_path('module', 'link') .'/link.css');
 
 
$description = '';
  if (!empty(
$element['url']['#description'])) {   
   
$description = '<div class="description">'. $element['url']['#description'] ."</div>\n";
    unset(
$element['url']['#description']);
  }
 
 
// Prefix single value link fields with the name of the field.
 
if (empty($element['#field']['multiple'])) {
    if (isset(
$element['url']) && isset($element['title'])) {
     
$element['url']['#title'] = $element['#title'] .' '. $element['url']['#title'];
     
$element['title']['#title'] = $element['#title'] .' '. $element['title']['#title'];
    }
    elseif (
$element['url']) {
     
$element['url']['#title'] = $element['#title'];
    }
  }

 
$output = '';
 
$output .= '<div class="link-field-subrow clear-block">';
  if (isset(
$element['title'])) {
   
$output .= '<div class="link-field-title link-field-column">'. theme('textfield', $element['title']) .'</div>';
  }
 
$output .= '<div class="link-field-url'. (isset($element['title']) ? ' link-field-column' : '') .'">'. theme('textfield', $element['url']) .'</div>';
 
$output .= '</div>';
  if (!empty(
$element['attributes']['target'])) {
   
$output .= '<div class="link-attributes">'. theme('checkbox', $element['attributes']['target']) .'</div>';
  }
 
$output .= $description;
  return
$output;
}
?>

#3

Version:6.x-2.6» 6.x-2.9

Has there been any more discussion to address this issue in Link module?

One thing that might be easier is to have a help text box for the title and the link. Then there would be separate elements for each.

#4

subscribe

#5

subscribing

#6

subscribing

#7

Simple solution via CSS might be to do something like this:

.link-field-column .description {
  margin-left:-100%;
}

Works in Chrome. Haven't yet tested it in other browsers. Also haven't tested in other themes, so maybe it's just my theme that allows it. If others can try it out and report back, that'd be great.

nobody click here