Phil's Drupal Blog

As a website developer I have decided to work almost exclusively with the Drupal CMS. I will continually update this blog with information regarding my experience with Drupal, recipes and code snippets that are helpful along the way.

In my experience with Drupal I have found it sometimes difficult to interpret the help/notes/instructions given by other developers - hopefully the documentation here will be easier to understand than most.

Arguments in header, footer and empty of Views

I know that this is going to come in handy - wait, it already has. Used it on the Michigan Outdoor Properties website (http://www.michiganoutdoorproperties.com) for the Listings by County and Listings by Use.

Link to stuff here: http://drupal.org/node/42599#comment-105738
This is how I am using it:

<?php global $current_view?>
<h3>You are viewing Michigan Outdoor ?>

Using Cron with Drupal and Cpanel

So, I need to research this to figure out what the heck is going on in this little script and how it works, but in the mean time - just for me and you - here is what works:

cd '/home/sitename/public_html' ; php -q 'cron.php' > /dev/null 2>&1

but this also works (I have this on another site):

php /home/sitename/public_html/cron.php

Clearing Civicrm cache

This one is just for me . . . because I always forget this stuff! To reset the CiviCRM cache (moving from localhost to live site for example) goto this address: civicrm/menu/rebuild&reset=1

CSS reset

I haven't tested it yet, but I am going to try using the css reset sheet with my Drupal site themes.

Code from: http://meyerweb.com/eric/tools/css/reset/

/* v1.0 | 20080212 */

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,

Anonymous access to user contact forms

in

I will often combine the bio module (requires cck), which creates a custom content type called "bio" and attaches it to each users account, with the personal contact form to create unique profiles/contact form for each user.

See what I mean here: http://www.michiganoutdoorproperties.com/broker/phil

The resulting page has a tab on the top that shows info and then the contact form.

Placing Secondary Links in a Block

When designing a custom theme I sometime want to put the set of secondary, or sub-page links, inside of a block in the sidebar. The secondary links are the children of the primary links, which you designate when creating the links.

Category / Taxonomy term links list

If you, like me, thought that you could use the "views" module to create a list of all of the taxonomy terms in a certain category - you can't. Views only displays lists of nodes. So, here is the snippet of code that you need to create to that list of links (you could put it in a block):

TinyMCE - Excluding textboxes

These are the text boxes that I have excluded by default so far. It would be easier to just include the ones that you want - but that's not the way it's setup.

As I find more module specific text boxes that I want excluded, I will update the script here.

Maximum File Size

I always forget how to fix the maximum file size for uploading on drupal. Simply add this:

  php_value  upload_max_filesize  75M
  php_value  post_max_size  75M
  php_value  memory_limit  32M

 
 
Copyright 2008 Journey Multimedia, Inc. || 1947 13th Avenue Unit A, Greeley CO, 80631