Pedro Posada | php snippet
  • Posted on November 3, 2010 - 10:41am
    Insert code snippet in template.php file.
  • Posted on November 3, 2010 - 9:57am
  • Posted on June 29, 2009 - 9:20am
    Creating a node programmatically. The best code snippet I found about this: http://drupal.org/node/178506#comment-1590834 Some people say is better to use drupal_execute(), but on my experience I would recommend to use the snippet above.
  • Posted on April 12, 2009 - 6:18pm

    I was trying to extract the text of an html tag using regular expressions. It seems that preg_match_all is a good option to do this. I wanted to extract the taxonomy term name from within a views display template. I needed to embed a views inside another views. I needed to use part of the parent view's html as an argument for the nested view. I used preg_match_all to extract the term name from an html tag.

  • 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 March 4, 2009 - 11:41am

    Insert snippet into a node's body. Select the php input format and submit the node.

    I found it here: http://www.computerminds.co.uk/bulk-deleting-drupal-nodes-particular-content-type