views:

162

answers:

2

Intro

I am in the process of trying to convert my first HTML/CSS design into a theme for Drupal. I have used ModX for quite a few designs and appreciate the ability to create different page templates and custom variables to be assigned to those templates. However I seem to be having some issues making the transition.

The site I am working on theming in Drupal is for a real estate agent. Each page/section will have a different set of content associated with it and will need to display only that content. For example, there will be a page for current listings, each of which will be formatted by a custom content type. However, when I call the content on the home page (or on other pages) I do not want to see this listing data.


Layout

The layout of the site and the regions associated with each page/section is as follows:

  • Home
    • Spotlight
    • Featured 1
    • Featured 2
  • About
    • Spotlight
    • Bios - Profiles of each agent (each will be a node with name, contact info, pic, etc) listed on the page; multiple nodes listed
    • Sidebar
  • Listings
    • Spotlight
    • Listings - Profiles of properties (each will be a node with locations, basic info, pic, etc) listed on the page; multiple nodes listed
    • Sidebar
  • Services
    • Spotlight
    • Content - general paragraph text area
    • Sidebar
    • News/Blog
    • News/Blog Items - List of stories with summaries and links to full article
    • Sidebar

Each page/section will use the same header and footer.


Issue

I have done some reading on Drupal, custom content types (and CCK), Views, and Pathauto. However I have not been able to get a clear picture of how to put it all together to accomplish what I am attempting. What I really would like to know is which modules to use, how best to use them, which elements I need to use where, and what template files I should be using to theme the elements I need to use. Any help or reference to useful resources would be much appreciated.

+1  A: 

This is a rather general question, and your description is a kind of vague on important distinctions like page vs. site section vs. page region. That said, some general advice: start by installing the admin module. Then get all your content generally in the right places with someone else's theme, e.g. Garland, before you start doing any of your own theming. You should be able to get pretty far without touching code. Use CCK to define your content structure. You should already have a type for page and it sounds like you'll want to add a type for feature, bio, listing, and blog post. Depending on the details, you may need to add some additional field modules, e.g. if you have images, you'll probably want the imagefield module.

Once you have the content types defined, configure pathauto, and start adding content.

Once you have some content, you'll want to create some lists of it with views. You may want to start with the simpleviews module, as the views UI can be overwhelming. Save your views as block display, and then use the blocks admin to put the in the right page region, and configure them to show up only on the right pages.

At that point, you'll want to start controlling how the individual items (nodes) look in different contexts. That's when you start theming. For that, I'd install the devel module, look at what other themes do, and call dsm() on any variables you don't understand to see what they look like.

You can generally get quick help with specific questions on the Drupal IRC channels.

Scott Reynen
A: 

The easiest way to do what you want to do may be to put your custom content in blocks and set the access settings for the blocks to be only on certain pages. So, for instance if you have content that you want to appear at /spotlight or /node/22 or such, you would just create a custom block (Site Building -> Blocks) and then in the settings, set the block to only show for that node.

nowarninglabel