1

I've created a custom block, and I want to show it on every page including the front page, except for pages of one specific content type.

In block settings, under "Visibility Settings", there is a list of checkboxes for each content type. If none are checked, the block shows on every page; but if any are checked, the block only appears on pages with the checked content type. So I tried checking everything except the one content type I want to exclude.

Except that this also excludes the block from the front page. It appears as though the front page doesn't have a content type you can choose to make the block show up.

Is there a way to get my block on the front page as well, while still excluding some content types from showing it?

  • 1
    Did you see the "Pages on which this PHP code returns TRUE (experts only) " option. Why not use that? – 2pha Aug 24 '13 at 4:22
2

The Context module is perfect for this task.

  1. Download and enable the Context module and add a new context under Structure -> Context

  2. Add a 'Path' condition and set it to <front> http://d.pr/i/x4R5

  3. Add a 'Node type' condition and check every node type, except the one where you don't want your block to show http://d.pr/i/PSO4

  4. Add a reaction called 'Blocks', on the right check the block you want to show when the first to conditions are met, and click 'Add+' next to the region where you want your block to show. http://d.pr/i/a3RG

  5. Save the context and that's it

Also make sure to leave 'Require all conditions' unchecked so the context will activate if the first or second condition is met.

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.