By JimShady on
I was trying to get a fairly simple block visibility snippet in place - it's not working and I can't figure out if I'm missing anything obvious here:
I want a block to appear on all pages with path /evergreen/* (my requirements are actually more complex than this but I can't even get this simple one working :(
I am using the following PHP test in the visibility section of this block:
<?php
$display_block = FALSE;
if (arg(0) == "evergreen") {
$display_block = TRUE;
}
return $display_block;
?>
This should work, shouldn't it? I made sure that my user has all the "use PHP" permissions. Also, if I manually change the last line to just "return TRUE;" then the block does display so the PHP is getting parsed.
Comments
The arg() function returns
The arg() function returns elements of the unaliased path. Is 'evergreen' part of an alias or an actual path?
thanks nevets!
Ah, it's the alias. Well, that explains that. I just found some examples utilizing drupal_get_path_alias which should help.
For anyone else who is just learning this about arg() and aliases, check out: http://drupal.org/node/838508