It seems like the Display Suite module completely ignores hook_preprocess_node() and hook_process_node(). Is this the case?

If it is so, what is the way to make minor changes to the final rendering with access to all the node variables?


Display Suite does indeed hijack the node rendering to a point where the default preprocess functions may not be used.

The module comes with a set of its own preprocess functions that are documented in ds.api.php.

In this case, hook_ds_pre_render_alter() can be used instead of the hook_preprocess_node() to modify the output via the complete render array. Also, the $entity object is available with all values.

  • how can i get $enitity in this hook
    – Moby M
    Aug 15 '18 at 8:16
  • @MobyM you can find it in the variable $context["entity"]
    – Renrhaf
    Nov 7 '18 at 4:54

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