Skip to content

Render paragraph item programmatically

Laryn - CEDC.org edited this page Oct 17, 2019 · 1 revision

If you end up with code that pulls the paragraph IDs from a field on an entity, you should be able to load the paragraphs as follows:

$paragraph_ids = array('23', '34');
$entities = entity_load('paragraphs_item', $paragraph_ids);
$paragraphs_render = entity_view('paragraphs_item', $entities, 'full');
print backdrop_render($paragraphs_render);