Skip to main content

Syndicate contentDrupal

How to show all of first article on front page

May 6, 2010 by Steve

I want the first article showing on the front page, the most recent one, to show full length, while the rest of the articles show teasers as they normally do. There are not a lot of good references to this in the Drupal.org documentation, nor on the forum, nor elsewhere on the internet. It took a lot more searching around to figure this out than I thought it would.

Basically, there are two ways to do it: use the Views module or hack the theme PHP.

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)

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 46 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 47 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. 5 years 3 weeks ago

Premium Drupal Themes by Adaptivethemes