2

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...

apaderno
  • 28,547
  • 16
  • 75
  • 90
David King
  • 2,010
  • 5
  • 19
  • 23

1 Answers1

1

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
  • 33,075
  • 15
  • 67
  • 82