I would like to propose a new feature for this modules.

Could be useful to have possibility to add a "Suffix and Prefix" (to use as a separators) after and before the content only in the situation when a single value is returned for a field.

An idea to avoid all workarounds that suggest to create a wrapper!

Thanks!

Comments

rjay’s picture

Status: Active » Postponed (maintainer needs more info)

I discussed this with my colleagues and we're having a hard time thinking of cases where this would actually be useful. Did you have a specific scenario in mind where you would use this feature?

Ryan

Dret’s picture

An integration for prefix and suffix in Semantic CCK will give the possibilities to move graphic separators, as (|) or (-), out of the field itself.

Example, an horizontal list of different fields, like:

09/09/2010 - London - Piccadilly Circus - 11:30 am

(composed by a Date filed + Text field + Text field + Date Field)

I can Give a specific markup to each field with Semantic CCK to build an unordered list or better a definition list. But I cannot insert in clean way "separators" between each fields.

Bye!

henrijs.seso’s picture

Status: Postponed (maintainer needs more info) » Active

This could be cool, I am now struggling with this. You could make it in content-field-FIELD_NAME.tpl.php but its hard to keep track of those :) So here is case - address.

Fields are:

label
street
building
premise
city
postal code
country

In form they have labels but in display, labels suck. So here is how Prefix and Suffix would kick ass...

<h3>label</h3>
<p>street building - premise</br>
city postal code country<p>

</br><p></p> and " - " are suffixes and prefixes.
James-TRMS’s picture

Yes, this would help me create a far more elegant and respectable end product where my display outputs several fields inline to read as a sentence. The ability to add commas and a finishing full stop would add significantly to the readability and quality of presentation.

The markup module allows this to some extent and, while brilliant elsewhere, is a really hacky solution as far as this problem is concerned and would require repeating over thirty times in my current form.

To be honest imho this would be best off as a feature of the cck text field itself, as it is with the integer field, but failing that, and with possible other benefits, it would be useful here, single or multiple fields.

rjay’s picture

Title: Prefix and Suffix field only for "Single Value" Setting. » Add the ability to specify a Prefix and Suffix for a field
Version: 6.x-1.1 » 6.x-1.x-dev
Assigned: Unassigned » rjay
Status: Active » Fixed

I have added the ability to specify a prefix and suffix for a field. This feature can be used with single and multiple value fields.

This feature is included in version 6.x-1.4.

Status: Fixed » Closed (fixed)

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

doublejosh’s picture

OMG, perfect. Thank you! This is actually filling a bit of a hole in Drupal CCK output. IMHO
Been fighting with this same issue for some time now too. I can't / don't want to use the various other options...

  1. Contemplate for mediocre architecture reasons.
  2. Display Suite, which is awesome but overkill and doesn't actually allow simple alterations to fields.
  3. Custom formatters, as it again ends up with PHP in the database for multiple value fields.
  4. Field template because I'm just adding a line of text and need it configurable.
  5. hook_preprocess or another code based solutions because I need it configurable.

All I need to do is add a configurable CCK field description to the display output below a multi-value field.
This should actually be rather simple, and the best above option was a "code field" within display suite.

iantresman’s picture

I think the Form Markup module may also help here