Consider this generic approach of rendering fields:

$wrapper = entity_metadata_wrapper($entity_type, $entity);
foreach ($fields as $field_name => $field) {
  $data = '';
  if ($field['type'] == 'property') {
    $property = $wrapper->{$field_name};
    $data = $property->value();
 }
  elseif ($field['type'] == 'field' && isset($entity->{$field_name})) {
    ...
    $renderable_data = field_view_field($entity_type, $entity, $field_name, $display);
    ...
    $data = drupal_render($renderable_data);
  }
  $build[] = $data;
}
...
return theme('ahook', array('data' => $build));

Now how to modify the code to add DS fields to the output?

Comments

OnkelTem’s picture

Title: Instructions on adding support for DS fields to other modules » Help with adding support for DS fields to other modules
aspilicious’s picture

Status: Active » Postponed (maintainer needs more info)

This will never work as display suite depends on the view mode settings which you're not passing .
If you still want to try this you should look the the alter function that builds the layout "ds_field_attach_view_alter" in ds.module

Enough information?

OnkelTem’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ok, I see. Thank you.

Status: Fixed » Closed (fixed)

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