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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | form_markup-correct_markup_for_each_instance-790476-2.patch | 961 bytes | mpv |
Comments
Comment #1
dkingofpa commentedI'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.
Comment #2
mpv commentedThe problem is that in
form_markup_add_markupit is usingcontent_fieldsto 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_readto 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 thatcontent_field_instance_readis defined incontent.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.