In this second installment of the views tutorial, we will clone the view we made in part 1 and modify it so the view only displays shoes with a style that is passed in as a part of the URL.  In other words we want to make a URL of the sort www.maxhoarder.com/hoard/shoes/style/Air+Max+1 that will display a view containing listings for all the Shoes with the style “Air Max 1”.

First lets clone our recent-shoes view.  To do this, use the admin menu to navigate to Site building->Views->List.  This takes us to the List tab of the Views page:

Drupal List Views Page

Continue reading ‘Creating Views In Drupal – Part 2’ »

Since we make this nice Recent Shoes view in the previous tutorial, lets set it to be our home page.  To change your Drupal home page navigate to Site configuration->Site information using the admin menu.  You will now be on the Site information page.  Simply update the url at the bottom of the page under the heading “Default front page” so that it is the URL of the Recent Shoes view page we just created. In my case since the URL to the Recent Shoes view page is http://www.maxhoarder.com/hoard/recent-shoes, I enter “recent-shoes” in the textbox to the right of the url “http://www.maxhoarder.com/hoard/” and then click the Save configuration button as seen below:

Change Drupal Homepage

Now if you go to the home page of your Drupal site you should see the Recent Shoes view page.

Now that we have our custom Shoe content type and our users can add their own Shoes, we need a nice way for user to be able to view the different Shoes on the site.  Just adding Shoes to the site with out any user friendly way to browse them is not of much use.  This is where the Drupal Views module (http://drupal.org/project/views) comes in handy.  The Views module allows you to create views.  A view is essentially a presentation of a predefined query of Drupal content.  For example, and for the purposes of this demo, we will be making a view with the 25 most recent Shoes in a display that is 5 Shoes across by 5 Shoes down.  For each of the 25 Shoes, it will show their main photo, their style, their style ID, and their would sell for price.

Before proceeding make sure you have the latest views module installed for your version of drupal.  This tutorial will be using Drupal 6.15 and Views 6.x-2.8.

To get started in creating our view use the admin menu to navigate to Site building->Views->Add.  This will take you to the tab of the Views page for adding a new view.  The view name is used internally by Drupal to identify the view so its name must be unique and it may only contain alphanumeric characters and underscores.  Since our view is going to display recent shoes lets enter “recent_shoes” in the View name text box.  In the View description text box enter “Recent Shoes”.  For View tag, enter “shoes”, so that this view will be grouped with other views that we assign the shoes tag to.  Since our view deals with Shoes, which are a type of node that we created, leave the Node radio button selected for the View type.

Add New Drupal View

Continue reading ‘Creating Views In Drupal – Part 1’ »

In this part of our content type creation tutorial we will create a node of the Shoe content type we created previously.  Before we can do so, we will need to set the permissions on Shoe so that users other than the administrator can view, create and edit them.  Before we proceed, I would also like to note that I have added some additional fields to my version of Shoe that I did not explain in the prior installment of this tutorial.  Since I am making an actual production site, I needed to add a few more fields than I felt it necessary to explain in the tutorial.  These fields include: Color, Condition, Size, Style, Style ID, Would Sell For, Year, and Additional Photos.

To get to the permissions page use the Adminstration Menu to navigate to User management->Permissions.  On this page you will see a table with three columns. The first column is the name of the permission. The second column is the permissions for anonymous user. The anonymous user refers to anyone using the site who is not logged in.  The third column is the permissions for authenticated user. The authenticated user refers to standard users who have created accounts on your site and are logged in:

Drupal Permissions Page

Continue reading ‘Creating Custom Drupal Content Types – Part 3’ »

In this portion of our lesson on creating custom drupal content types, we will update our custom Shoe content type so that it has a Brand field whose value users select from a dropdown of predefined choices.

We will start on the where we left off on the Manage Fields tab of the Shoe content type page.  In case you left that page and can’t find your way back, simply navigate via the admin menu to Content management->Content types->Edit shoe->Manage fields.  Once there lets add our new Brand field the same way we added Description in part 1.  In the New field row of the Shoe table enter “Brand” in the Label column, enter “brand” in the Name column, select “Text” from the dropdown in the Type column and then however this time select “Select list” in the dropdown in the Operations column:

Add Select List Field To Drupal Content Type

Continue reading ‘Creating Custom Drupal Content Types – Part 2’ »

In this tutorial we will be creating a custom drupal content type called a Shoe, which site users can use to post details and images of their shoes to the site.

The main unit of content on a drupal site is a node.  Pages are the primary type of node that people create.  The About Us and Terms and Conditions pages we created in earlier post are examples of page nodes.  Now image we want a more customized content type where the create page for that content type takes in some specialized fields and then results in more formatted content.  In my case I’m making a site for sneaker collectors to post their sneakers.  Sure I could just allow everyone to create pages on my site with their sneakers on them, but this would not have a very uniform look and feel or be very organized either.  Also, letting just anyone make their own page on your site raises a lot of security issues, because people could put malicious content in these pages or even spam.  Instead, we will be taking advantage of drupal’s Content Construction Kit, better known as CCK.

CCK (http://drupal.org/project/cck) is a drupal module that allows you to define your own custom drupal node types with properties that you define.  In standard CCK, these properties can be text, numeric, user references, or boolean values.  For additional property types, the File Field (http://drupal.org/project/filefield) and Image Field (http://drupal.org/project/imagefield) modules can be installed to allow for file and image property type.  For the purposes of this tutorial you will need to install those modules before proceeding.

Continue reading ‘Creating Custom Drupal Content Types – Part 1’ »

To protect your site legally, it is general practice to make users agree to a set of terms and conditions when making an account on your site.  You can either have a lawyer help you come up with your terms and conditions, or find a service on the internet that supplies them, or create your own.  I personally generated a free one using the tool here http://www.easyriver.com/free_disclaimer.htm and added some stuff to it.  Once you have your terms and conditions you can create a Terms and Conditions page on your site.  I recommend creating it the same way as in the previous About Us page post.

After creating your Terms and Conditions page, you can use the Terms Of Use (http://drupal.org/project/terms_of_use) drupal module to make users agree to your T&C when creating an account.  Once the module is installed, go to the Terms Of Use configuration page at Site Configuration->Terms Of Use and enter the title of your T&C page into the text box labeled “Title of the post where your Terms of Use are published” as seen below:

Drupal Terms Of Use

Finally, click “Save configuration” and the next time a user creates an account they will see the following:

Drupal Terms And Conditions

If you look at the URL of the About Us page created in the last post you will see that it is “http://www.maxhoarder.com/hoard/node/2”.  This is not a very user friendly URL.  To make drupal automatically generate user-friendly, meaningful URLs for your nodes, you can install the Pathauto module(http://drupal.org/project/pathauto). Pathauto requires that Path, a core drupal module and Token (http://drupal.org/project/token), another drupal contrib module, so you will also need to download and install Token to get Pathauto working.

Since we are just now installing Pathauto content created before will not have aliases generated.  We need to go back to the “About Us” page and manually update it to use automatic alias generation.  This can be done by editing the About Us page and expanding the “URL Path Settings” section and then checking the “Automatic alias” checkbox as seen below:

Change Drupal Page Alias

Once you click save on the page, the a new url will be generate for the page that is based on the page title.  In our case, the page URL is updated to “http://www.maxhoarder.com/hoard/content/about-us”, since the page title was “About Us”.  Now that pathauto is installed and enabled all pages created from now on will automatically have URL aliases generated for them without you having to change the setting in each page as we just did.

To add an About Us page (or any other basic content page of your choosing) to your site, use the admin menu to navigate to Content Management->Create Content->Page as seen below:

Drupal Create Page Navigation

This will take you to the Create Page page.  Here you will enter the page title “About Us” in the text box labeled “Title” and add your page content in the text area labeled “Body”.

To make your About Us page show up in the main site menu, click on “Menu Settings” to expand the “Menu Settings” section.  Add the title “About Us” where it says “Menu link title” and select “<Primary Links>” in the “Parent Item” dropdown.

Create Drupal About Us Page

Continue reading ‘Adding An About Us Page To Your Drupal Website’ »

To start customizing your drupal site, one major thing you can do is to add your own logo to the top section of your pages.  To do this you will need to edit the settings of your theme.  In my case, I will be editing the Fusion Core theme.  I get to the theme editing page using the Admin Menu and following the path Site Building->Themes->Configure->Fusion Core as shown in the picture below:

Navigating To The Drupal Theme Editing Page

Once on the editing page you will scroll down to the “Logo image settings” section and uncheck the “Use the default logo”  checkbox.  Then click the “Choose File” button next to where it says “Upload logo image” and select your logo file from your computer.  Once you select the file the page should look similar to the following with the name of your logo file next to the “Choose file” button:

Setting Your Drupal Theme Logo

You should then navigate to the bottom of the page and click the “Save configuration” button.  Now if you look at the top of the page you should see your logo there:

Drupal Theme Logo