Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged drupal



1 2 3 4 5 6 ... 11
Example from New Play Map
0 929 posted 14 years ago by mimlee
Example used in New Play Map
0 856 posted 14 years ago by mimlee
Suppress button to "split summary at cursor" on node bodies that are generally short and won't ever be displayed as teasers. (These lines go in hook_form_alter functions.)
0 1042 posted 14 years ago by tgbdad
Suppress the input format section of a node form when you don't really want users (even admin) to change it. Particularly handy for uncluttering forms with lots of CCK fields on them.
0 924 posted 14 years ago by tgbdad
0 1023 posted 14 years ago by picxelplay
0 945 posted 14 years ago by resting
1 972 posted 14 years ago by apro2000
**Important: this snipplet has moved to Github.** - [Force the admin theme on additional non-admin paths in Drupal 6](https://gist.github.com/1973090)
3 1249 posted 14 years ago by wildpeaks
If you're importing nodes from a file and have pathauto setup, the existing paths for the nodes will be rewritten with pathauto. To avoid this, simply add the following to the node export array for each node:
0 992 posted 14 years ago by jonathanpglick
**Important: this snipplet has moved to Github.** - [Programmatically log out the user in Drupal](https://gist.github.com/1973079)
0 1024 posted 14 years ago by wildpeaks
Just include **global $user;** and **$user->uid != 1** into the function
0 1182 posted 14 years ago by resting
The total number of search results can be added in a hook_preprocess_search_results() function from the following variable:
0 1142 posted 14 years ago by jonathanpglick
0 1079 posted 14 years ago by hamsterbacke82
Drupal 6 Do this after $view->execute() has already been called
0 1113 posted 14 years ago by jonathanpglick
0 1066 posted 14 years ago by hamsterbacke82
0 755 posted 14 years ago by jmaties
To be placed in template.php preprocess_page function.\\r\\n\\r\\nBreaks stylesheets into 2 style tags with limit of 30 @imports each. IE has a limitation of 31 @imports or 31 style tags. (source: [http://john.albin.net/ie-css-limits/single-style-tes...
1 1053 posted 14 years ago by resting
Drupal snippet
0 1278 posted 14 years ago by apro2000
0 870 posted 14 years ago by JohnnyGamba
0 1123 posted 14 years ago by resting
1 1102 posted 14 years ago by resting
0 996 posted 14 years ago by screamwork
1 2 3 4 5 6 ... 11