0

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

1
+50

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,
    ),
  );
  • I did that. No luck. Would you show me a file of a feature that had exported with the format configurations in it? For me it is weird that a module as DS do not has this kind of integration with Features, but... – Beto Aveiga Mar 28 '18 at 17:26
  • @BetoAveiga I have updated my answer with a feature element example – Maria Ioannidou Mar 29 '18 at 7:21
  • Ok Maria, I think you are right, now my life has sense again :D – Beto Aveiga Mar 29 '18 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.