It'd be great if you could implement a way of allowing Domain fields (specifically the 'Domain access options') to be draggable in the 'Manage fields' area of a content type's settings.

Currently, there is no way of specifying the weight of the domain fields (other fields like Taxonomy have a weight option in their own settings), so it makes it hard to specify where they should appear in the node creation form.

In a CCK issue, yched explained how module developers could implement this: Changing the order and thus weight of cck and node fields...

Thanks!

CommentFileSizeAuthor
#7 domain-cck-weight.patch1.56 KBagentrickard

Comments

agentrickard’s picture

Patch?

Anonymous’s picture

:) That's why I said "how module developers could implement this"...

I'm not a module developer... yet.

agentrickard’s picture

Status: Active » Fixed

HEAD is in flux pending the bootstrap patch. This has been committed, but the patch would be off for 6.x.1.2. So just paste teh following function to the bottom of domain.module.

/**
 * Implements hook_content_extra_fields()
 *
 * CCK hook to allow sorting of the domain settings field.
 */
function domain_content_extra_fields($type_name = NULL) {
  if (!empty($type_name)) {
    return array(
      'domain' => array(
        'label' => t('Domain access'),
        'description' => t('Domain-specific settings for posts.'),
        'weight' => 1,
      ),
    );
  }
}
Anonymous’s picture

Status: Fixed » Closed (fixed)

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

jacerider’s picture

Status: Closed (fixed) » Active

I believe, in order for this to work correctly, the following needs to happen:

$form['domain'] = array(
        '#type' => 'fieldset',
        '#title' => t('Domain access options'),
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
      );

Needs to be changed to:

$form['domain'] = array(
        '#type' => 'fieldset',
        '#title' => t('Domain access options'),
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
        '#weight' => module_exists('content') ? content_extra_field_weight($form['type']['#value'], 'domain') : 1,
      );
agentrickard’s picture

Why? It works as is.

agentrickard’s picture

Version: 6.x-1.2 » 6.x-2.0-rc5
Status: Active » Fixed
StatusFileSize
new1.56 KB

Actually, we both have it wrong. The CCK API is confusing on this point, but the proper fix is attached and committed.

Thanks!

Status: Fixed » Closed (fixed)

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