By t42 on
Is there any way to add a sidebar depending on the content of the node? For example, if the node content contains the string ".pdf" it turns on a sidebar block which tells people they can get Reader from the adobe website?
Is it possible using some cleverly crafted php in the page visibility options of the block?
Cheers,
t42
Comments
Yeah, I guess that would be
Yeah, I guess that would be possible..
You'd have to do something like this:
Hope that helps!
__________________________________________________________
Mark Theunissen
Code Baboon
Drupal based services
Nearly there...
For some reason it doesn't like that TRUE on the stristr. Remove that and it works like a charm!
It produces interesting error messages on admin pages, but I can probably work those out myself.
Thanks Mark!
No problem! I just typed
No problem! I just typed that code without any form of testing at all, so yeah there is probably a bit of work to do on it before it works properly! ;)
__________________________________________________________
Mark Theunissen
Code Baboon
Drupal based services
You may also want to do some
You may also want to do some sanity checks, make sure that the path is /node/xxx
__________________________________________________________
Mark Theunissen
Code Baboon
Drupal based services
Explore Side Content
Explore Side Content module
http://drupal.org/project/sidecontent