Hello,

Please help me: how I'll know if drupal is displaying an image gallery from other module?

For example if drupal is displaying an image gallery i need to display a block from my custom module but if drupal display any other content type hide that block.

I tried with "if(variable_get('image_gallery_nav_vocabulary',NULL)){//the code here}" but is not working.

Thank You very much!!!

Comments

joachim’s picture

Status: Active » Fixed

The image_gallery_nav_vocabulary variable is just the vid of the vocab that represents galleries. Testing against that tells you exactly nothing.

You basically need to test the path -- what this is depends on whether you are using Views or not.

SilviuChingaru’s picture

Status: Fixed » Postponed

I'm not using views... can you give me a simple example on how shoud i check the path? shoud i use drupal_get_destination or what func?

Sorry for my nob questions but i'm in hurry with this project and... I don't have so much time for research.

Thank you very very much joachim!

joachim’s picture

Status: Postponed » Fixed

Use arg(). Bit ugly but until Drupal has a proper notion of context that's all there is really.

SilviuChingaru’s picture

Status: Fixed » Closed (fixed)

Thank is what i needed... Thank you very much you saved me a lot of time.