Question

I'm trying to export a node display with features and I already created the feature with the display and imported it to another site.

The problem is that the display has some differences, mainly in the format of the fields (see the graph in yellow). It seems that the format of fields are not exported. I checked the generated code and found nothing about these formats.

Moreover, I'm changing the formats of the fields and features do not change at all, it status is not "Overriden", and I generated it anyway and there is no change at all, despite the different formats.

I don't know if it is a common issue with Display Suite or if I should active another module to do a better export.

How to fix this problem? Do you have exported node displays with features? What else can I do.

enter image description here

Était-ce utile?

La solution

The format and other settings of the field in a DS display are exported as part of the field instance element containing an array of settings per DS display. So, except from the DS display you have to track all the Field instances (from the related Feature section) in your feature.

An example of an exported field instance of a text field field_location with format Plain text in the Full DS view mode in feature file my_module.field_instance.inc is:

// Exported field_instance: 'node-image-field_location'.
  $field_instances['node-image-field_location'] = array(
    'bundle' => 'image',
    'default_value' => NULL,
    'deleted' => 0,
    'description' => '',
    'display' => array(
      'default' => array(
        'label' => 'inline',
        'module' => 'text',
        'settings' => array(),
        'type' => 'text_plain',
        'weight' => 42,
      ),
      'full' => array(
        'label' => 'above',
        'module' => 'text',
        'settings' => array(),
        'type' => 'text_plain', // This is the exported format
        'weight' => 0,
      ),
      'teaser' => array(
        'label' => 'above',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 0,
      ),
      'token' => array(
        'label' => 'above',
        'settings' => array(),
        'type' => 'hidden',
        'weight' => 0,
      ),
    ),
    'entity_type' => 'node',
    'field_name' => 'field_location',
    'label' => 'Location',
    'required' => 0,
    'settings' => array(
      'entity_translation_sync' => FALSE,
      'text_processing' => 0,
      'user_register_form' => FALSE,
    ),
    'widget' => array(
      'active' => 1,
      'module' => 'text',
      'settings' => array(
        'size' => 60,
      ),
      'type' => 'text_textfield',
      'weight' => 21,
    ),
  );
Licencié sous: CC-BY-SA avec attribution
Non affilié à drupal.stackexchange
scroll top