Article
Posted on 20th July 2021
Takes about 4 mins to read

Sometimes it can be handy to have extra pages for a node (or any entity). For example: * To show different sets of information on separate pages for a single product, page, or thing. * So you can set different access requirements on each page for a node. * You want to block access to the ordinary route (e.g. node/123 and its aliased equivalent) for some reason, but you still want some other page to...

Article
Posted on 14th June 2021
Takes about 3 mins to read

I'm a fan of configuring things for display through Drupal's admin UI. It gives site builders confidence and power. What if you want to place blocks or views listings in amongst fields on pages of content? For example, to display: A listing (view) of related content, such as accessories for a product A standard contact block, advert, or some other calls to action in the middle of the content, exactly where the user is best 'caught' in their journey, rather than having to stick those in sidebars or after all the content fields. Some specific value(s) pulled from fields on some indirectly related entity, through a token, such as details from a taxonomy term representing the 'section' that a page is in. Consistent relevant links on user profiles to take people to common destinations This is where the Entity Extra Field module (entity_extra_field) comes in. It supports embedding blocks, views or values to be replaced via tokens. So a site builder can set these up to be managed just like ordinary fields on the page (whether it's a node, term, paragraph, or any other type of content).

Article
Posted on 13th January 2014
Takes about 2 mins to read

Previously on this website I have written about rendering blocks programmatically and adding things to content to be managed alongside fields. It's time to combine the two! On many projects, we find ourselves needing to render a block consistently across all content of a certain type. For example: Are you trying to place advertising blocks or fixed javascript code between the fields in the content of a page, not just shoved into regions around the...

Article
Posted on 28th February 2012
Takes about 4 mins to read

UPDATE: The Extra Field and Extra Field Settings Provider modules facilitate doing this sort of thing in Drupal 8. Read on for older Drupal sites, and for the concepts behind this. We often want to add things to the content of a node or any other entity in Drupal 7 using hook_node_view(), hook_node_view_alter() or a similar hook in a custom module. This could be anything from a custom social media link, a field rendered in...

Article
Posted on 10th February 2011
Takes about 2 mins to read

We've been using Display Suite with Node displays on one of our latest sites. It was an experiment, and possibly not something we'll do again - DS offers some great functionality with build modes and ways to re-arrange fields and all sorts on nodes, but since we end up theming most nodes quite a lot anyway, it's not worth the extra hassle that Display Suite can add when you want to change the theming on...