I working on my site in development mode and I am having a hard time understanding the routing system of drupal. If I wanted to have a calender for my users would I make a template file and add the functions to template.php ( in the theme ) or do I make a module that would handle the functions with a tpl file in the module and draw that into a layout ( page template )? If this is done, do I also make checks on the url to tell page.tpl what content to show?
For an item to show up in a menu do I need to make a tpl.php file for the menu item? To me anyways it's pretty confusing. I have been reading making modules in drupal 6 and building robust websites with drupal 6. I am pretty good in algebra and do understand classes, functions and arrays. Should I drop reading the books and read the core code instead?
I am used to just building regular layout template files ( usually static headers and footers ) and pulling in the content ( albeit sidebars, blog content and whatnot ). I think maybe I might be over thinking this aspect of drupal.

Comments

dnewkerk’s picture

Yep I think you're over-thinking things :) No worries though.

If you want to make a calendar, the way to do it is with Calendar module - which is a way of presenting nodes from Content types (CCK module) that have a date field added (DateAPI module), using Views module, the data of which is "presented" in a calendar format (but could just as well be presented as a list, table, RSS feed, or whatever you want). No programming or templates (other than for theming purposes) are required. Here's a video on setting up the calendar: http://www.drupaltherapy.com/node/76

For a piece of content (called a node) to show up in a menu, you can simply choose where to place it in the menu while you create or edit the content, using the "Menu settings" option. Or you can go to the main menu managing page at admin/build/menu and add or customize any menu items you want by specifying a name for the menu item, and a URL that leads to the page. You can also add a Views pages or other URLs to the menu (in Views you can do so either through its own interface, or just the same way you do with other pages in the main Menus page).

By using a few key modules (namely CCK and Views, and various field types/expansions you can plug into those), unless you need to program custom functionality that is not otherwise possible, you can create highly custom Drupal sites with little to no programming (besides theming, which is about 90% plain HTML and CSS, and just a tiny bit of PHP to draw in Drupal's dynamic variables where they need to appear). If you want to get into custom Drupal module development, contributing patches, etc then definitely please do... though just letting you know that if you don't want to do that, you can get a very long way with Drupal without actually writing any code.

Read some of the lessons on my Drupal guides link which should help get you going in the right direction.

-- David
davidnewkerk.com | absolutecross.com
View my Drupal lessons & guides