Markup for a field is setup in the CCK type specific setting section ("These settings apply only to the XXX field as it appears in the YYYY content type."). This should mean that markup set for field 1 used in CCK type 1 should not affect field 1 if used again in CCK type 2.

If the field is re-used in a different datatype, it appears to have different markup in

admin/content/node-type/ccktype1/fields/field_field1

and

admin/content/node-type/ccktype2/fields/field_field1

but I found that a "

" tag affected both cck types edit screens.

Comments

dkingofpa’s picture

I've run in to this as well. The Form Markup fieldset displays under the "[Content Type] Settings" fieldset on the create/edit form, but it actually applies globally. The only workaround I can think of is to NOT reuse cck fields across content types. The fix is to just use Drupal's templating system instead of this module.

mpv’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Assigned: Unassigned » mpv
Status: Active » Needs review
StatusFileSize
new961 bytes

The problem is that in form_markup_add_markup it is using content_fields to get the fields, which returns only one instance for each field, and is not always the one you are looking for.

The attached patch uses content_field_instance_read to get the field instances. That way we are always getting the correct instance and don't repeat the markup in different CCK types. The patch is made against 6.x-1.x-dev (works with 6.x-1.1). The thing is that content_field_instance_read is defined in content.crud.inc (which we need to include) and i'm not shure if we should be using it.

I've just made this modifications. It's working for me but please test.