Drupal coder

Drupal Snippets : Share you code

A 'snippet' is "a programming term for a small region of re-usable source code or text", says Wikipedia. Of course there are a lot of snippets available for such a popular environment as Drupal.

In the Drupal handbook, the official documentation for Drupal, you can find two sections with snippets. One is for general PHP, SQL, view, block, ... snippets. The other is for theme snippets.

There are also two unofficial resources available, DrupalBin, a pastebin website for Drupal, and Drupal Snippets. The second one has few snippets available right now though. So the most dynamic resource to keep an eye on is DrupalBin.

There's probably a few more. I invite you to submit those in the comments.

March 12, 2008Drupal, module development, snippets, theming

Comments

Where can I find a good website teaching me, a dummy, more about maximising my website.

For instance I need simple templates in producing user friendly formats eg. for placing material on my site in a specific way (got an example of something basic developed in dreamweaver)

How do I remove the readmore and no of reads from $links?
How to I attache a image to $links in front of the link login to comment(in $links). All in Drupal 5

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options