1

How would I go about restructuring certain elements from a node so they are within different containers. E.g. If I had a node with 8 different fields and I wanted 4 of them to be rendered within a list, 2 of them within a certain div and the last two in a table. How would I do this?

Should I do it in hook_node_view_alter() and restructure the build array with nested containers, and if so, wouldn't this be quite expensive for large nodes compared to telling the rendering array to nest, according to some conditions, as it is structured? If so where would I do this?

Should I do in a post_render function or?

1 Answer 1

0

The Field Group module will allow you to group fields into containers you may then be able to alter some of the mark up with the Fences module.

It does sound like you need more control so if those modules don't work you'll have to get your hands dirty in some code. The template files node.tpl.php and field.tpl.php should give you all the control you need over the mark up.

0

Your Answer

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

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