By aharown07 on
I've learned how to display a block only in the currently logged on user's profile page (http://drupal.org/node/134433)
But what if I want it to display on a couple other pages also? Don't know how to do that.
I've learned how to display a block only in the currently logged on user's profile page (http://drupal.org/node/134433)
But what if I want it to display on a couple other pages also? Don't know how to do that.
Comments
You can list pages under the
You can list pages under the block visibility pages. Just list all the pages you want there and use * as a wildcard.
node pages
You could an an elseif to that code:
In that case, the block would show on the specific page at node/12. It depends what the path for the page is in that type of situation. node/12 would be the full display of a given node.
Does that work in your situation? If not, where do you need it to display?
a smile for you
sorry.no smile
Thanks
Yes, the elseif approach should work. Will be a cpl days before I get a chance to test it, but it make sense.
Thanks!
One question though, what would the condition look like if the page is not a node? For example, how about the main forum page? Not sure what variable to use there.
arg(0) == 'forum'
I'm pretty sure it would be:
arg(0) refers to the first part (argument) of the URL path after the domain name. arg(1) is the second part. And so on.
Confirming
Yes, that works. Many thanks!
Just out of curiosity (since I'm learning something here) how would I display on the front page? Tried 'front' and '' and 'frontpage' but none of these work.
Views Frontpage / admin/settings/site-information
One option is to:
- Enabled the default frontpage view (views of course)
- And than assign that path to your default front page through your admin settings: admin/settings/site-information.
drupal_is_front_page()
http://api.drupal.org/api/function/drupal_is_front_page/6
You can use the handy drupal_is_front_page() function from the API to check if a page is the front page. So...
Cool, thanks
Didn't know about drupal_is_front_page
Very handy