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.

TinyMCE Page Break

If you want to insert a page break, or a teaser break using tinyMCE view the little explaination here. Although you can use the Drupal Break plugin with older versions of TinyMCE, the best way to get it working with TinyMCE 3 is to use the pagebreak plugin that already exists and configure it to output the <--break--> tag that tells drupal where to split your teaser and page content.

SuPHP, .htaccess and php.ini

I have recently updated my server (or rather had my hosting company update it) - twice. In total the server configuration had to be recompiled 3 times, causing a bit of downtime - but all in all it looks like it's finally in good shape.

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

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):

Blog Terms

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