Home

Primary links

  • top o the deck
  • Drupal for Beginners
  • about
  • links
  • give me some sugar

Drupal stuff

  • EDAM
  • STARDOM
  • Question Bank
  • Drupal musings
  • Drupal tips
Home Blogs Drupalace's blog

Key stuff on this site

Easy Drupal Admin Manual (EDAM)

SEO, Traffic and Revenue: Drupalace's Online Manual (STARDOM)

Drupal for Beginners

Subscribe to posts by RSS or email

Subscribe to Drupal Ace by RSS feed RSS feed 

Subscribe to Drupal Ace by Email

Donate towards my web hosting bill! Get a great host!

Share and save

Share/Save

Random piece of content

Trackback devilry again

Manuals on this site

  • Easy Drupal Admin Manual (EDAM)
    • Welcome to Your Site
    • First Steps: Please Read!
      • Understanding These Instructions
      • Important Terminology!
      • Best Practices for Site Admins
    • Super Quick Guide (for the experienced and the brave)
    • Logging In
    • Your Administrator Tools
    • Setting Site Basics
      • Setting Site Information
      • Configuring Your Theme
    • Creating Content
      • Node Types
      • Create a Page Node
      • Create a Story Node
      • Create a Blog Entry Node
      • Making Images and Other Files Available
      • Using Text and Image Editors
    • Organizing Your Content
      • Terms, Vocabularies, and Taxonomy: "Tagging" Your Content
        • Taxonomy Suggestions
      • Menus, Links, and Paths: Navigating the Site
        • Content Paths and URLs
        • Creating Links
        • Working with Menus: Administration Form (Drupal 6)
        • Working with Menus: Administration Form (Drupal 5)
        • Creating Menu Items on the Fly
        • Placing Menus on Your Pages
      • Placing Content on pages
        • Creating a page from a Single Node
        • Creating a page from a List of Nodes
        • Setting the Front Page
      • Working with Blocks
    • Maintenance Stuff
      • Maintenance and Construction Notices
    • Other Fun Things
      • Changing Color of Garland Theme
      • Free Aliases!
  • SEO, Traffic and Revenue: Drupalace's Online Manual (STARDOM)
    • Set a Clear Goal
    • Make a Good Site
      • Put out the Welcome Mat
      • Make Great Content
      • Build a Great Brand
      • Make Navigation Easy
      • Tune Site Performance
    • Drive Traffic
      • Promote your Site
      • Get Found with SEO
    • Build a Community
      • Build an Offsite Community
    • Monitor and Improve
    • One-Page Checklist
    • Drupal and the Blogging Starter Checklist
      • Drupal and the Blogging Starter Checklist, Part 1
      • Drupal and the Blogging Starter Checklist, Part 2
      • Drupal and the Blogging Starter Checklist, Part 3
      • Drupal and the Blogging Starter Checklist, Part 4
      • Drupal and the Blogging Starter Checklist, Part 5
      • Drupal and the Blogging Starter Checklist, Part 6
      • Drupal and the Blogging Starter Checklist, Part 7

You said it!

  • Tough one to Inves...

    I have heard and read stories such as this one before, and their common denominator is Drupal...

  • exclude

    excellent tip - can highly recommend the module - installed and working perfectly in drupal 7

  • Great CMS

    This book seems very interesting as I am currently starting a project to build a community site...

  • Thanks!

    Thank you very much !

  • Thank you very muc...

    Thank you very much !

more

A Drupal realization: Views rules

Submitted by Drupalace on Tue, 2008-01-15 11:45
  • blog post
  • Drupal
  • Views

As an Ace in name only, I am only slowly realizing what the sharper cards in the deck have known all along: that for making "list of nodes" pages, Views is the way to go.

(I think I'll change my site's Mission now: "Drupalace.com: Bringing you the blindingly obvious since 2007.")

I've previously put lots of work into creating many a taxonomy-based list page, on many a site. Such as, for example, a primary link called News Articles, which returns a list of nodes which I've tagged with the terms "news" and "article". In Drupal terms, that'd be done by creating a menu item News with a path like

taxonomy/term/21,24

(See related discussion at Understanding node-list pages in Drupal.)

That's all fine; nothing wrong with creating lists that way. But I've always thought it an oddly clunky and inflexible method, and wondered why the Drupal gods hadn't polished it up more.

I realize now the wisdom of the Great Ones: the above method isn't the preferred way of making lists and isn't worth a lot of developer effort to make prettier. Views is the way to go. Views will make those taxonomy-based lists, or a boatload of variations, just as handy as you please – and with added features to boot.

Here's an example: adding header text to a Views list. That's a right useful thing to have – say, a bit of intro text for my hypothetical News Articles section: "The following news articles have been selected by educators for easy reading comprehension and kid-friendly explanatory graphics. They are recommended for elementary students, intermediate learners of English, and people named Dubya."

In the past, I had to fake headers like that. I'd make a node (Page, Story, whatever) with that text, tag it with "news" and "article" like other nodes I wanted to appear in the list, and check the "sticky" box. Voila, it would appear at the top of the list, looking for all the world like a header!

But it's a sham header, really just a node like everything else in the list. And then I'd run into troubles whereby some other taxonomy-based node list would, whether I like it or not, pick up that "header" node. For example, an All Articles list, returning all nodes tagged with "articles", would pick up that "header" node, even though it's not actually an article...

Views solves that. It offers a real header, unique only to that list. It's a thing of beauty (sniff).

Oh, and I just got myself jiggy with yet another Views trick: the Insert View module (http://drupal.org/project/insert_view). Make a node, put a special little tag in the text, and you get node + view – two great tastes in one! That's another fine way to add a header to a list, using the node to supply the header, and the embedded view for the list. The result may look the same as just ouputting the normal View with its own header, but it's a useful alternative when you plan further operations in which it's easier to work with a node than a view.

The Viewfield module (http://drupal.org/project/viewfield) looks like it may be yet another way of doing the same, without the minor bother of injecting a special tag into node text. (I dislike polluting actual text with input tags...) I'll have to give it a try.

Ah, my toolbox runneth over. Views, I'm feeling frisky. Let's you and me get a room.

(But let's not get cocky and think I'm actually starting to grok things. For example, "arguments" in Views: what's up with that? I have no idea what one would do with that.)

Share/Save
  • Drupalace's blog
  • Printer-friendly version
  • Quote
Unknown Drupaloid's picture

Re: A Drupal realization: Views rules

Submitted by Unknown Drupaloid (not verified) on Mon, 2008-04-14 22:45.

Thanks! It's obvious stuff for most users, but useful for beginners.

  • reply
  • quote

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><br><p>
  • You may quote other posts using [quote] tags.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options


Relevant Content

The Drupal Ace logo has dealt these content suggestions from the deck.

  • Working with Menus: Administration Form (Drupal 6)
  • Test post using MarsEdit 2.4
  • Drupal site recipes
  • Drupal and DreamHost: An Update
  • Drupal beginner documentation picking up steam
  • Working with Menus: Administration Form (Drupal 5)
  • Updating Easy Drupal Admin Manual

Learn Drupal, hands-on

Get the beginner-friendly ebook that teaches community site building via a live case study.

Drupal 6 Ultimate Community Site Guide

Read the review

It's a deal!

Dreamhost dealsDrupal Ace presides over his domain, proudly ensconced in his DreamHost eyrie. Won't you join me?

Promo code deal!

Just enter the code 49ER when you register for an account, and save $49 off the already-low price. No strings!

Read my hosting service review

Drupal mini tip

As noted in Forum Finds: Node deletion is forever, when you tell Drupal to delete a node it gives you one "Are you sure...?" chance to recapitulate, but that's it. Confirm the deletion, and that node is gone; there's no Trash Can or Undo to get it back.

To prevent mishaps, be careful in giving users permission to delete nodes. Also, make it a rule to unpublish, not delete, nodes when you want to take them off the site. The node will disappear from view just as if it had been deleted, but will remain in the database should you ever want to republish, reedit, or otherwise revisit it.

Powered by Drupal, an open source content management system

Copyright 2007 and forever after. Made with Drupal, of course. On OS X, of course. Served up by DreamHost. DreamHost

RoopleTheme