1

The following scenario: - i have for example a standard block region through a pages of a site: "highlights" - for the frontpage i have an additional region: "highlights_frontpage" - i put a block into "highlights_frontpage" - i have to put into the visibility textarea: ""

If i remember correctly for D7, otherwise the block is loaded everywhere even though he is only shown on the frontpage.

Has Drupal 8 the same behaviour in loading blocks? My page has for each main menu page an own region, but it would be a little bit ugly for the editor if he has to place the block via the administration in one region and also has to set the visibility ...

thanks

  • Interesting question. Can you test it yourself? A dpm() call in the block cobtent builder should inform you whether the function was run or not. Make sure you disable block cache. – AyeshK Jan 16 '15 at 13:50
1

The block is loaded (otherwise we could not check if he should be shown or not), but we do not call build() unless the block is visible and the user has access.

I'm pretty sure that was already the case in Drupal 7, it is only Drupal 6 AFAIK where it was building the blocks and then checking visiblity.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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