Skip to main content

Syndicate contentBuild This Site

A series of tutorial posts on how to install and configure Drupal 6.16 in order to make a website like this one.

How to change the CSS for the <code> tag

May 6, 2010 by Steve

As installed, the <code> tag definition in the Newswire theme has extra space between each line of output. I needed to tighten that up so that code snippets will be a little more readable. I'm using Firefox with Firebug installed, so I can right-click on the code and choose "Inspect Element" from the menu. Firebug shows me all the CSS that builds the display for that part of the page.

I learned that the <code> tag was defined in sites/all/themes/newswire/html-elements.css, on line 61, which looks like this:

pre,code { margin: 1.5em 0; white-space: pre; }

How to move the tags around on the node

May 3, 2010 by Steve

The part of the node layout that gives you all your taxonomy terms is called "terms". I've got these as subject tags, so I want them next to the title of the post. The default for Newswire is to have them at the bottom right, so I need to move them. This requires rearranging the PHP code in node.tpl.php and making some CSS changes, but none of this is too difficult. (This will be easier to follow if you have sites/all/themes/newswire/node.tpl.php open in the text editor of your choice while you are reading this.)

Hacking the theme

May 3, 2010 by Steve

The Newswire theme is just about exactly what I wanted when I first started drawing out my site on paper. There are just a few things that I wanted to change. Here's what I did:

  • Moved the "tags" block of links ("Drupal, theme, hack") for each node from the bottom right to the upper left. (Both CSS and PHP changes required.)
  • Changed the look for <code> sections. (CSS)
  • Changed the first post on the front page to print out full length. (PHP)

Thanks for reading!

April 30, 2010 by Steve

If you read all this way, thank you! I hope you found this tutorial to be helpful. Please don't hesitate to contact me with any suggestions for improvement.

As I add more features to the site, requiring more modules to be set up, I will continue to add pages to the tutorial, so that it always reflects the current site setup.

Main menu

April 30, 2010 by Steve

I want the main menu items to be the names of the Sections from my first Taxonomy group. In the Newswire theme, the big colored stripe across the top is the location for the Primary Links menu, so that is the next thing to configure.

Configure the Print module

April 30, 2010 by Steve

The Print module makes printer-friendly versions of your pages, as well as making nice versions for email, and allowing access to a few different third-party PDF generation packages. I'm just using it for the printer-friendly link you see on each node.

Configure the Links module

April 30, 2010 by Steve

From the Links project page, the "Links Package is a multi-module set for managing URL links in a master directory, and attaching them in various ways to your content pages." First, this allows you to attach "related links" to your nodes. There are other ways to do this, but Links allows you to attach an arbitrary number of links, from zero to many, and have the layout work nicely. (This was important to me.) Links stores all those URLs in a database, and if there is ever a duplicate, it manages that gracefully.

Configure the Views module

April 30, 2010 by Steve

It is not an overstatement to say that the Views module seriously changed Drupal development when it was released. Before Views, if you wanted to change the layout of a page or make a block that showed your data in some custom way, you had to write a module to do it. Depending on your needs, you may still have to, but a great many display solutions can be done through the Views interface.

Configure the Nodewords module

April 30, 2010 by Steve

Nodewords enables meta data for your pages. This is used to give search engines hints about what is in the page, things that might be good related search terms. It is not just one module, but a package of related modules. One is the API, one is the UI, one enables appropriate tokens, and so on. Though all the files are named with "nodewords", the package is labeled "Meta Tags". In my setup, I turned all of them on except the "Meta tags for custom pages", since I don't need that yet.

Configure the Ping module

April 30, 2010 by Steve

Ping is a module that notifies the Pingomatic service that your content has changed, which then can push out that notification to other web sites that want to know.

The title of this post is a bit misleading. There are no configuration settings for Ping. Turn it on and it works.

There are no permissions to configure for Ping.

@stevew99999

  • @rosamundlannin I make regular chili but use that veggie crumble meat substitute stuff. 4 years 38 weeks ago
  • @Snarky_Geek Since I was awake at 4:30 this morning, and finally just gave up and went to work around 5:45, I feel your pain. 4 years 39 weeks ago
  • One of the Chicago office dogs really wants to play this morning @the_nerdery, keeps bringing toys over to try to start something. 4 years 47 weeks ago

Premium Drupal Themes by Adaptivethemes