Pedro Posada
  • php.ini directives
    Posted on October 26, 2008 - 5:05pm

    These are some of the directive you can use to have your website work a bit better in terms of uploading files and showing really long pages like modules page and blocks page in the admin section of drupal.

    Create a php.ini file in your site's root folder and copy and paste this code into it.

    register_globals = Off
    memory_limit = 96M
    post_max_size = 100M
    upload_max_filesize = 100M
    max_execution_time = 1000
    max_input_time = 1000 

    You can also check this link for more good info on how to fix server memory problems. http://drupal.org/node/76156

  • Views argument dynamic filters
    Posted on October 19, 2008 - 1:29pm
    Go to this link: http://drupal.org/node/70145#comment-928042
  • How to make stylesheet refresh automatically
    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.
  • PREV NEXT links for nodes in circular way
    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.
  • How to create a custom search box
    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.

  • Place Pager at top and bottom of Views view.
    Posted on August 5, 2008 - 12:44am
    This code helps you place the pager at top and bottom of your views. Copy and paste this code into your template.php file. use_pager) { $output .= theme('pager', '', $view->pager_limit, $view->use_pager - 1); } $output .= theme_views_view($view, $type, $nodes, $level = NULL, $args = NULL); return $output; } ?> Tested in drupal 4.x and 5.x
  • Zebra css style
    Posted on June 16, 2008 - 10:10am
    When using "VIEWS" you can insert this into your node.tpl.php. This will allow you to create Zebra style lists of teasers and/or full nodes.
    http://drupal.org/node/82241
  • Naturally Splendid
    Posted on June 11, 2008 - 10:39am
  • Collapsible fieldsets
    Posted on May 26, 2008 - 4:16pm
    Code snippet to build collapsible fieldset like this one:
  • Block visibility php snippets
    Posted on May 26, 2008 - 10:19am
    Display a block on certain pages by url and by node type.