Skip to main content

Syndicate contenttheme

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)

@stevew99999

  • @MRFranklin20 switch back and forth for now. Words on paper is good. 5 years 25 weeks ago
  • Remote iOS controlled pan-and-tilt base for an iPhone? Yes, please! http://t.co/aUz8WxKI Need before next business trip! 5 years 25 weeks ago
  • @Holloboles Just a man. With a man's courage. Nothing but a man. But he can never fail. 5 years 25 weeks ago

Premium Drupal Themes by Adaptivethemes