Skip to main content
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
added 120 characters in body
Source Link

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 Panelsmodules exist, but what's the downside of this solution?

  1. Define a specific region content-front in theme
  2. Place some blocks in this this region
  3. 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 or hook_preprocess_block will not be called for a block not being rendered.

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 Panelsmodules exist, but what's the downside of this solution?

  1. Define a specific region content-front in theme
  2. Place some blocks in this this region
  3. 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.

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 Panelsmodules exist, but what's the downside of this solution?

  1. Define a specific region content-front in theme
  2. Place some blocks in this this region
  3. 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 or hook_preprocess_block will not be called for a block not being rendered.
Source Link

Downside of not rendering a region in twig template?

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 Panelsmodules exist, but what's the downside of this solution?

  1. Define a specific region content-front in theme
  2. Place some blocks in this this region
  3. 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.