views:

391

answers:

1

I build a BLOCK that sits on a right side of the website and is available for whole site.

Also I got a many CONTENT_TYPE NODES like (pages, news,gallery, files).

How can I modify _preprocess_xxxxx and which one, so I can let my BLOCK know which CONTENT_TYPE is currently displaying.

so then my BLOCK displays var $section = top 10 download for CONTENT_TYPE==files; and for CONTENT_TYPE==news, I will see latest news in my block var $section. etc, etc...

+1  A: 

You can use a preprocess to solve this, but since you have made your own block it is a lot easier to handle this from within the block code.

You can use arg to check if the block is being displayed on a node, and then check what type that node is. You'll have to disable the cache for the block though, or else it wont work.

googletorp

related questions