Pedro Posada | drupal recipe
  • Posted on December 9, 2009 - 10:17am
    This is the best php tip I have found for reseting drupal administrator's password.
    You will need access to phpMyAdmin or some way to manage your database. Run this query
    update users set pass=md5('NEWPASS') where uid = 1;
    I found the info here: http://kb.siteground.com/article/How_to_reset_my_Drupal_admin_password.html
  • Posted on August 7, 2009 - 11:48am
    I am building a website for a photographer. I want the photographer to be able to do bulk or mass image uploads. Usually the images are very big files around 3MB to 5Mb each. I figured the best way to do this was by using image and image_pub modules. This way the photographer can use the Gallery Remote Java Client to create galleries and preview bulk uploads.
  • Posted on March 7, 2009 - 5:43pm

    This piece of code is to generate a menu or list of links to taxonomy pages. I used it inside a block. I created a view that shows all items under certain taxonomy term.

    It is basically a taxonomy menu but you can customized an place it anywhere.

    Good link to learn more about embedding your own views: http://groups.drupal.org/node/10129

  • Posted on October 13, 2008 - 3:06pm
    When I build a site, I always make changes to the style.css file. I always add, modify or remove styles, but there was a problem. When someone came to see my site they would see an old version of the site because their browser would cache the style.css file. In order to avoid this, I came up with this drupal recipe or theme snippet.
  • Posted on October 8, 2008 - 2:15pm
    This is just a sample of how you can add PREV NEXT links to your node type template. This function generates links to navigate your nodes in alphabetical order ASC.
  • Posted on October 2, 2008 - 3:37pm

    This is an example on how you can create a custom search box for your drupal site. The code below renders a text box and a button. When you perform a search, drupal will only look for the keyword inside the node types specified below (page, recipe, product, blog_article). You can just copy and paste this code into a block.

  • Posted on May 26, 2008 - 4:16pm
    Code snippet to build collapsible fieldset like this one:
  • Posted on May 26, 2008 - 10:19am
    Display a block on certain pages by url and by node type.
  • Posted on May 15, 2008 - 4:22pm

    This php snippet is useful for customizing the behavior of the "My account" link. Sometimes you want to place a login link in one of the menus. It might be confusing sometimes because after you login, the link won't show as "Logout" but as "My account". This is not ideal so you can use the snippet to make it show as "Logout".

    Place this code inside your template.php file.

  • Posted on April 24, 2008 - 4:40pm
    Php snippet to insert a webform in any node.