Block Visibility on a per-language Basis

Ready for review -- AWAITING PEER REVIEW

Sometimes you want some blocks to only show for specific languages. This lesson shows you how to enable/disable blocks on a per-language basis.

  • Enable the language switcher block.
  1. Go to Administration > Structure > Block Layout (/admin/structure/block) and click "Add custom block" to create a custom block.
  2. Enter "Language Specific Block" as the title.
  3. Enter "This block is language specific" as the body and then click save.
  4. On the next form, elect the language tab among the vertical tabs.
  5. Limit the block to certain languages.
  6. Save the configuration.
  7. Enable the block you just created by specifying which region the block should be located.
  8. Click save.
  9. Switch your site's language with the language switcher block to see your language-specific blocks in action.

You have just learned how to create blocks that are enabled on a per-language basis!