Category: Drupal

How to NOT display Titles on Static Pages in Drupal

This is basically a way to style elements according to what kind of node they are in. So a title in a book page will look different than a title in a story.

This is based on some code written by Erik Hopp as shown in This thread
The idea is, we want each element to have a style assigned to it that not only makes a distinction between the ELEMENT type but the NODE type the element is in. So for example, instead of a title being styled only as

   <h1 class="title">This is the Title of a Static Page</h1>

we want the class name to specify that this title is within a “particular” type of node.

        <h1 class="title-page">This is the Title of a Static Page</h1>
or
         <h1 class="title-story">This is the Title of a Story</h1>
Continue reading

PHP Alternating Color Table Rows for Drupal or Dreamweaver sites

This is based on the great tutorial by phpfreak at phpfreaks.com For a more complete explanation of this, take a look at his article.

The main variation I have made here is to adapt it for the drupal database and to separate the HTML more from the PHP to make it easier for designers to alter without needing to escape the code characters: a big source of errors for those of us who are not writing code day in and day out.

This will also work well dropped into a Dreamweaver-created php site – just change “nid” and “title” to whatever fields you want to display instead, and use the query dreamweaver generates when you define a recordset.

If you are new at this, it may go more smoothly if you first create a dynamic site in Dreamweaver, then create a dynamic table with whatever fields you want, THEN add in the additional code to generate the colors by comparing that file and this.

Continue reading

Drupal: Suggestions for improving Drupal’s Book Module – Part 2: Navigation

1. Navigation should be visible most of the time. The first time I looked through a book created with the Drupal’s book module, I recall being confused about how to proceed through the document. My confusion resulted from starting on a long page, so that the “previous/up/next” navigation had fallen below the “fold.” Since I was new to Drupal-based books, I wasn’t even aware it was there.


A long page where navigation has dropped below the fold.

The only other visible navigation which was relevant to the book was the breadcrumb trail at the top of the page, which allows the reader to jump “up” a level but not backwards and forwards between pages of a chapter.

I did figure the system out within a few minutes, but I’ve watched others who are less interested in “figuring things out” attempt fruitlessly to find their way around such issues, and pretty much give up. It is amazing how people don’t think to look around the page, or having looked, misunderstand what they are seeing.

Continue reading

Suggestions for Improving Drupal’s Book Module – Part 1: Administration

Note: a wiki containing this article and many other more in-depth discussions of drupal usability is HERE

A while back I promised to write up some suggestions for improving the book module. I finally got some time, so here they are. I’m posting this here because as far as I know, the drupal.org forums don’t yet allow images to be posted.

I am mostly interested in improving the navigation for the end user of drupal-based books, but I will start with my suggestions for changing the administration of books. Navigation suggestions will follow in another post.

1. When you browse to any page of a book, and click “administer,” you go to the editing screen for that one page.

At the very bottom of the editing screen, there is a button “Edit book outline” that allows you to administer the relationship of that one page to the outline of the rest of the book.
takes you to:

Continue reading

Alphabetical Title Browser for Drupal

Note: See also PHP Alternating Color Table Rows for Drupal or Dreamweaver sites

I needed an alphabetical browser of all published nodes, and couldn’t figure out how to do it using existing Drupal tools, so created one in Dreamweaver and made a static page out of it. Maybe someone can make a Drupal module out of? it. It needs at least four big improvements that I can think of –

1. The Dreamweaver connection code needs to be Drupal-ized
2. It is written in the backwards Dreamweaver way – the php gets inserted into the html, rather than having the php output the html as part of the stream of code.
3. It needs to have the alternating table rows
4. It needs to be paged, when the list gets too long.

Continue reading