Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
I've seen the code snippets to display a block based on type of node (say story or book). However, what if I want to show a block on the home page as well (<front>). I couldn't find a PHP sample for that anywhere.
Anyone know how to do that? What I'd like to have is a menu block that has a list of "User Guides" which will be books. I'd like that to be displayed on the home page (right side), AND also displayed as any book page is displayed. But I would want it to go away when other node types such as Story are displayed.
I need to hide some of the fields that appear when a user edits a page in drupal. This is to prevent certain drupal user roles in my system from seeing certain fields and to supply values for those fields programatically. For example, I'd like to have the the parent and weight fields be hidden fields instead of actually appearing on the edit page. I've looked at doing this brute force by modifying the content variable on-the-fly via PHP in the theme templates, but that seems rather clumsy - like I'm fighting drupal rather than working with it. Is there a better way to do this?
This is my first module. It is meant to record tutorials between tutor's and students, but it could be used for employee evaluations etc. The module is pretty well finished, BUT there is a flaw with it, as soon as I enable it on the modules page then (og) group members are denied access to their group pages - this is without creating a tutorial node. As soon as I disable the module then group access is restored. I have fought with this problem for the last couple of days and I've no idea what could be causing it.