How to Create a Custom Front Page in Drupal 7

## Update, I’ve created a screencast for how to create a custom front page in Drupal 7 <- click there
Things you'll need:

(module) Front Page

Step 1: Install the module Front Page

Step 2: Configure

Go to Administration > Configuration > Front Page

By default, Front Page installed on a blank installation of Drupal 7 will give 3 options for settings, Administrators, Authenticated Users, and Anonymous Users. Any additional roles you have created should also show up here. You can set a custom home page for each of your users. I find it easiest to set it for an anonymous user and test in a separate browser as an anonymous user.

You have a few options with how much control over the front page you give yourself (these are copied from the module itself):

themed: means your default layout, theme and stylesheet will be loaded with your custom front_page.
full: allows you to have a completely different layout, style sheet etc.
redirect: will automatically redirect visitors already logged in to a specific page specified in the REDIRECT TO box.
alias: will display the page listed in path as if it were the home page. This option does not redirect.
I use the “full” setting. I create my homepage in an html editor on my local machine, put the CSS styles in the header (you can link it to an external stylesheet later if you’d like), and test it out as a standalone page. Then, once you are pleased with the result, paste the entire html document into the “data” textarea. This textarea works just like any other textarea in any other drupal node. So you may choose full html, restricted, or whatever text format types you have created.
Hope that helps!

Drupal 7 Memory Limit

Recommended settings for the php.ini file for Drupal 7:

memory_limit = 96M
max_execution_time = 200
max_input_time = 200
register_globals = off
output_buffering = 1024

I’m currently testing these settings out on a site, and we’ll see how it goes. Getting a 200 OK error occasionally. Any help is appreciated…we’ll see what happens.

Include external javascript in your Drupal theme file

Go to your theme’s .info file.

Insert a line that says this:

scripts[] = js/script.js

Everything after the ‘=’ is the relative path to your javascript file. This is where you can put your custom actions.

delay: 1d12h

How to Create a PHP Text Format in Drupal 7

Step 1:
Modules > Enable PHP filter, save settings.

Step 2:
Configuration > Text Formats. Click “Add Text Format”. check the “PHP evaluator” checkbox, plus anything else you would like. Also, consider adding this for certain roles only…this is a dangerous tool to give people if they don’t know what they’re doing.

Create an easy jQuery Slideshow in Drupal 7

This post will explain how to create an easy jQuery Slideshow using Drupal 7 with a few modules.

##Update: Click here to see the screencast, or here to download the files.

What you’ll need to crete a jQuery slideshow in Drupal:

  • Drupal 7
  • Module – Views
  • Module – Views Slideshow
  • Module – Libraries
  • Library – jQuery Cycle

What you’ll be able to create:

Note: This way of doing it means there is a piece of content for every slide. This is not one piece of content with an “unlimited” image field like a gallery. That is not covered in this tutorial. Maybe later. This allows for more control over your jQuery slideshow.

Step 1:

Create a new content type called “slideshow”. It should have 3 fields:

  1. Title (default)
  2. Link (text field, default settings, this is for where you are going to send people when they click on the image)
  3. Slide (Image field, set number of values to “1″)

Screenshot 1, Content Type settings

Step 2:

Add content. In the “link” field, put something like “http://www.bentedder.com“, just to test it. Add an image, and a title, and then repeat a couple of times so we have a few images to test. Try different URLs in the test images to make sure the linking is working.

Step 3:

Create 2 new image styles

  1. slide – 470 x 250px
  2. pager – 40 x 40px

Create Image Styles, Screenshot 2

Step 4:

Create a new view. Details should be as follows:
Show: Fields, default settings, no inline fields
Add Fields: (put in one at a time so the fields can be linked to each other)

  • Link (from the slideshow content type), check the box to exclude this field from display.
  • Slide (formatter: image, image style: slide, link image to nothing, select “output this field as a link” and put “[field_link]” in the link path)
  • Slide (yes, again. formatter: image, image style: pager, link image to nothing, and exclude from display)

 

Step 5: (still in the same view)

Format: Slideshow (this is where you need the views slideshow module + jQuery cycle module/library), with the following settings:

  • Bottom Widgets, check “pager”
  • Pager Type: Fields
  • Check the third box, “content: slide” (this should be third if you did it in order in step 4, it should be the excluded slide field that is formatted with the pager image.
  • Check “Activate slide and pause on pager hover”

Step 6: CSS

This isn’t necessary, but otherwise your pager images will appear on top of each other. This floats them left next to each other.

.view-slideshow .views-slideshow-pager-field-item {
 width:40px;
 height:40px;
 margin-right:5px;
 margin-bottom:5px;
 float:left;
}

Step 7:

Make sure you set the correct filter criteria (content type = slideshow, published = yes). Sorting your results will affect in which order the slides appear. You cannot sort manually with this tutorial.

Step 8: include in a page to test

The sloppy way to do this, and for testing purposes, is to just include this view in a page. Make sure you have an text format setting that allows php input. Then put this in the body of the page, save and view.
Note: I’ve also built this jQuery slideshow package as a downloadable file that you can use and customize.

Hope it works for you, email or comment and I’ll help you out.


Download Files:

Drupal 7.12

+ Modules:

  • ctools
  • views
  • libraries
  • views slideshow

+ Libraries:

  • jQuery Cycle

+ Customizations:

  • Slideshow with pager – custom view (with block)
  • “Slide” content type
  • Page with embedded block code
  • Installation Notes

 download now ($3) [.zip, 6.6MB]

Drupal vs. WordPress

As a web designer, it is important to be familiar with your tools. For months, almost years at this point, I’ve been a strong advocate of Drupal. I admit, I only started when it was in version 6, but still….

Recently I’ve started using and designing in WordPress. It’s interesting, the two do very different things. Here’s a little pros and cons list as it plays out in my head.

Feature Drupal Wordpress
Theming Relatively easy Very Easy
Expandability Amazing Limited
Ease of install Very Easy Very Easy
Ease of transfer Very Easy Somewhat Easy
Size/Bulk Quite big Quite small
Navigating files Difficult Easy

That’s a short list. I still prefer drupal for the bigger sites that require lots of customization, and obviously that aren’t blog-centred. But for blogs and very simple sites, I’m thinking of switching to wordpress for a quick win for clients.

Any thoughts?

A Little Bit of History

So my intent with this blog is to give my 2 cents, as well as tutorials, how-tos, and ramble along the way on wordpress, drupal, and sharepoint, and see what happens. Hope you enjoy it!