1

I have a custom content type I call a Listing. It contains a few hundred fields, and it has a custom template, which renders the node indie the main content area.

How do I configure the sidebar and other blocks to appear/not appear for only this content type and not all content?

1 Answer 1

1

This depends on the information you would like to show in the sidebar. If you want to show some static information like for example a help text, then you can create a block in admin / structure / blocks. After you added a new block, you can modify the visibility settings of this Block (and many other settings). For example set the block to to show only on a specific path, content type or whatever.

The other way or case you might have, is to show dynamic data which has a relation to the content you're currently looking at. These dynamic blocks can be built for example with Views or you can create them programmatically in an own module.

The placement of the blocks works like on the first case. But there are other ways to place a block (e.g with Context).

3
  • Thanks, that helps. I'll check into the visibility settings. Where are they located? Commented May 23, 2012 at 18:17
  • Just go to create a block and look at the options on the bottom of the page.
    – Lance
    Commented May 23, 2012 at 18:19
  • I was looking into hook_block_view_MODULE_DELTA_alter to do it programatically...and then I realized that I could just configure my content as blocks, and define each block, rather than using the template to map node fields to locations on the page. Ultimately giving my users more configuration options for the custom content. Commented May 23, 2012 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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