In Drupal 7, I need to be able to selectively remove paragraph components from a given node. Which parts of the $variables array need to be unset?

1 Answer 1


Pretty easily it seems. Something like the following does the job for removing the first component, for example:

function THEME_preprocess_node(&$variables) { unset($variables['content']['field_landing_page_components'][0]); }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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