Closed (fixed)
Project:
Gallery
Version:
5.x-2.x-dev
Component:
Blocks (Image-/Grid-)
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Oct 2007 at 21:04 UTC
Updated:
19 Nov 2008 at 00:09 UTC
I have gallery2 embedded in Drupal. I want certain blocks in the right and left sidebars to be hidden whenever the gallery2 module loads and displays content from a certain album. I have tried to configure the blocks in question so that they don't show on pages following the name of the album directory (i.e., www.mysite.com/drupal/v/album1/) but this doesn't work. I have tried other configurations using wildcards, but no matter what the blocks continue to show up whenever any gallery pages are loaded. Does anyone know a way around this problem?
Comments
Comment #1
profix898 commentedWhat exactly did you enter for block visibility? I'm doing this all the time to hide right sidebar blocks on gallery pages and simply having 'gallery' and 'gallery/*' hides a block ... Not?
Comment #2
immanence commentedThanks for this.
When I enter "gallery" or "gallery/*" (etc), the block is hidden on ALL Gallery pages. What I'm trying to figure out is how to hide it on specific gallery pages associated with specific albums. The URL displayed for gallery pages is always something like:
www.mysite.com/drupal/v/album_name/
The string "gallery" doesn't appear in the URL (perhaps because I have clean URLs?). When I attempt to hide the block(s) using, for example, "v/album_name*" it doesn't work. Any idea what I'm doing wrong?
Comment #3
profix898 commentedThe problem is that G2 urls (from G2 URL Rewrite plugin) are not registered as url aliases in Drupal. Thats why the block visibility settings dont apply when provided with your clean url pattern. However you can easily match the pattern against the request uri.
This may look like this ... (untested)
Paste this snippet into the 'Pages' field and set 'Show block on specific pages' to 'PHP-mode'. This should hide the block on all specified pages.
Comment #4
immanence commentedThanks again. Unfortunately it doesn't seem to work. The block keeps showing up on the album pages.
Comment #5
profix898 commentedSeems to work for me. You can add
drupal_set_message(print_r(request_uri(), TRUE));somewhere to see what paths are returned from request_uri(). Make sure to type them literally and mind the slash that prefixes the path.If it doesnt work, replace the code from #3 with
return (request_uri() != '/gallery/v/album_a/');. This should show the block on all pages except '/gallery/v/album_a/' and proof the concept ...Comment #6
alexandreracine commentedI hope that everything is working for you.
DEV version not supported anymore.
------------
Feel free to reopen but please look at the latest version first! It's probably fixed.
http://drupal.org/project/gallery
Closing (cleanup)