Suppose we want to use a different layout/blocks in front page. I know there is a page visibility restriction feature in block configuration, and also Page Manager
and Panels
modules exist, but what's the downside of this solution?
- Define a specific region
content-front
in theme - Place some blocks in this this region
- Render this region only in
page--front.html.twig
template
The above solution has some advantages: front-page blocks are listed separately from other blocks, no need to configure each block to be in <front>
page (preventing a O(n) task), using native UI to arrange the blocks.
Edits:
- hooks like
hook_block_access
orhook_preprocess_block
will not be called for a block not being rendered.