there should be some more textfields in the expert-field-template to make it look more important and expert-ish

for this reason there could be a pre and suffix field

I need this to put a zip code and a city name on one line divided by one space

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swentel’s picture

Status: Active » Closed (duplicate)
swentel’s picture

Status: Closed (duplicate) » Closed (won't fix)

Going to wait with this one - field group is a better and easier option actually to get this working.

loominade’s picture

Status: Closed (won't fix) » Active

I recently have the problem that i want to have a suffix like <br /> and &nbsp; after a field and only if it is outputted. i think this cant be achieved using fieldgroups

aspilicious’s picture

Status: Active » Closed (won't fix)

This is not going to change in Drupal 7.

Angry Dan’s picture

Version: 7.x-2.x-dev » 7.x-2.4
Status: Closed (won't fix) » Needs review
FileSize
3.08 KB

I needed this so I wrote a patch (it's against 2.4, because that's what I have installed but it might apply against -dev)

It just provides two big textareas - one for prefix and one for suffix so that you can put whatever you like in there - either to add a single tag at the end or to wrap a field in whatever markup you choose.

yannickoo’s picture

+++ b/modules/ds_extras/includes/ds_extras.admin.inc
@@ -405,6 +405,19 @@ function ds_extras_field_template_settings_form(array &$form, array &$form_state
+    '#prefix' => '<div class="ft-wrappers">',
...
+    '#suffix' => '</div>',

I would put them in an extra key because this is kinda confusing.

+++ b/modules/ds_extras/includes/ds_extras.admin.inc
@@ -405,6 +405,19 @@ function ds_extras_field_template_settings_form(array &$form, array &$form_state
+    '#type' => 'textarea',
...
+    '#type' => 'textarea',

A textarea, really?

Here is screenshot of the patch from #5.
Screen Shot 2013-10-11 at 23.53.03.png

aspilicious’s picture

Status: Needs review » Closed (duplicate)

This is now officially a duplicat of #2076897: Prefix/suffix

Angry Dan’s picture

yannickoo, my use of #prefix and #suffix for wrapping an element is commonplace, both in Drupal and in DS and although I wouldn't normally do this across elements as I have done here, I was duplicating a practice used elsewhere in the same function for consistency. For that reason I'd suggest a separate issue and patch to change all usages of the practice, as irritating as that may sound.

And yes, really a textarea. Maybe with less rows, but definitely a textarea. That form is far too compacted as it stands - the classes and attributes fields are far too squashed in already.