DrupalCamp: Views

Jennifer’s Drupal Cheat Sheet (I think I’ve linked to this via delicious at some point)

Some references to what she’s used for this.

Pages to be made with Views: Upcoming classes, Courses We Offer, Instructors

Having a good (pathauto-style) URL helps for getting blocks onto pages, matching with wildcards.

Views under Site-Building. Starting point is a lot like starting with a content type, and similarly no 2 views can have the same machine-readable name.

Basic choice is page vs. block. Basic explanation of blocks. If it’s going to have a URL, it’s a page, if it’s going into some other page, then it’s a block. Can make the same View have a Block & Page version. (?)

View types (more types avail thru modules) – full node, then another full node; same thing with teasers; table (grid, one row/node); list; Calendar & date browser she’s never used. (Very curious about the date browser) Here she uses table.

“Front Page View”?

Pagination options. Alpha pager module available. (For youth site taxonomy pages?)

Filters (I think this is where I got stuck) – oh, scheduling! Maybe I need to add effective date as separate from the actual publication date. “Field_course_date: Date” or something like that – greater than or equal to now.

(musing out loud: unique *something* with an effective date today or earlier?)

if you have sorting enabled on a table, don’t use default sorting?

clicking on Edit on the page created by a View goes to the View editing page.

“clone” (kinda like that thing in the intranet software)

sorta wishing I were coming tomorrow. special topics for theming sounds interesting, as do Panels & Image Handling.

Views Theming Wizard?

export/import, can’t use on the same site, but from one site to a different site with the same structure. also used as a way to do staging from dev to production.

audience q: how would you improve views? to be able to put into a table a field from a reference node. yeah, that would be cool. she’s thought about writing a module to do that. “there may be a module that does that, but I haven’t found one.”

the drupal slogan: “there’s a module that does that.”

“Views Union, I tried, it’s awful.”

Can do some crazy thing with list view as a dummy view and then frankenstein together something. Whew.

Exposed filters. O hey. That would be nice for jobs.

Adds an “exposed filters” area after clicking “expose” button. Locking the operators makes the most sense. [“Digital painting” class? That would be RAD…is that the subject for Painting the Web? πŸ™‚ ] “Always lock the operators…makes no sense to the end user”

Could you set up the filter zone as checkboxen rather than one of those weird select things?

And is there an Ajaxy way to filter w/out clicking submit? (jQuery) An audience q that’s fairly similar…

“Views Filter Block” makes the filtering zone take less space.

[oh, another diversity point: this seems like a wider age range than one often sees. the occasional “kid” but also quite a few oldsters.]

Instructor page with Upcoming & Past/Current class lists – Block Views.

[more] link on Block vs. pagination on Page

Empty text if there are no results “This teacher hasn’t taught anything yet” or on a page view w/exposed filters “try your search w/out filters” or similar.

Can’t do “only classes that this teacher has taught” in filters. Nothing here that’s dependent on which page it’s being shown on. Aha.


based on the URL, pass info to do extra filtering. Oy that looks complicated “argument handling code views” search πŸ™‚ arg(0) = node, arg(1) = 34 (or whatever)

set the instructor number that goes into the argument to the number of the node.

so why do you need pathauto?

to put it on the page, edit Blocks. oh, and it’s just in the content block. (I missed how to make sure it just shows up on the right pages. oh, that’s where pathauto comes in, pattern matching.)

I think I’m going to ask my Q about the weird rates stuff on the DUG list, or maybe go to one of their meetings.

DrupalCamp: CCK

weird screen problems!

Basically, this & the Views session after lunch are one session.

Hey, she’s using an example. Excellent, I always learn better from examples. An art organization that offers art classes.

Planning, writing out ahead of time what you’ll need. Connecting instructor & course to create a scheduled class. (Some of what I was trying to do with rates?)

Each piece of information should only be entered one time. (Ala normalizing databases.) Linking to those pieces. (Yep, she just said the same thing re: database design.)

Now the how-to. “Content” in the CCK section. (for downloading)

When you start, all that’s there is Page & Story. After CCK is installed “Add content type” tab/link is available.

Machine-readable name is usually same as human-readable, but w/out spaces, etc. (node template teacher.node.tpl?)

Descriptions matter most when you have lots & lots of content types.

Every node has a title & a body. Full stop. But may not make sense in context of node. (In this instance, what about alphabetizing? Oh, she’s renaming it as “Displayed name of this teacher” — so presumably you could add first & last names separately? Although that seems annoying.) “Your main goal is not to get phone calls…support calls from the users of your site.”

Usually leaves minimum at 0, because users often have partial information. (I like how much she’s thinking about the needs of the data entry person.)

More thoughts about workflow in re: published by default — is that what you want?

Discussion of whether to use Body for something like Bio, because of conflicts with creating Views and/or Templates. (Looks like she learned something new! Fun.)

Create fields once the content type has been created.

Borrow a field from another content type. (Borrow a feeling? πŸ™‚ Also, can’t have 2 different fields with the same name.

She probably should’ve left offΒ  one of her content types before the presentation?

Node reference comes bundled, btw, but has to be enabled.

Ah, now I can see that you can use a text field w/validation for dates. (And does ANYBODY use datestamp?)

On Node Reference, Use select list when only a few, use autocomplete text field when lots & lots.

Hundreds of other CCK content type modules. (Although not so many for D6. Oh, had good chat over the break with Greg (heyrocker guy) and ??? (tall guy, maroon t-shirt) about whether to go D6 or D5. Sounds like for a new site, D6 is the better way to go, even though some modules are still missing, buggy, etc. That’s just where the energy is.)

Covering some particular issues in the image type, including checkbox. (Oh, can put name of person in alt attribute via theme!) If resizing pic, don’t worry about max file size?

If stuff isn’t required, make sure the theme doesn’t break down. Definite focus on making it work easy for data entry, make the Drupal developer do all the work. πŸ™‚ You can also have a default image. Audience member had problem with default image, conflicts with “required.”

Discussion of weight and D5 vs D6. (Hiding weight & using drag/drop? teh HAWESOME.) But…she’s missing some key modules. Grr. This is the basic issue with deciding on a version: D6 is just a better user/admin experience while D5 has more stuff.

“Mrs. Jane Q Smith III”?! heh. Ah, she has done just what I was thinking. First/Last name are fields for sorting & searching, but hidden on the display page.

Can use a single date field for start and end date, and a single date field for times.

CCK field “Date” — viewable via Calendar, Date API? (missed some of that.)

More detail on the Node Reference type; checkbox for which node type(s), and then also advanced that uses Views for selecting.

Now for Taxonomy…mismash of wording references (as mentioned in Drupal 101) “kinda schizophrenic” — and apparently another thing that got better in D6.

[so what’s the deal with lunch?]

Back to the planning list. How did we want to organize this stuff? 2 sets of terms: one set for subject area, one for age level. Better explanation of when to use taxonomy! Things that cut across multiple content types. A class has subject area & age level; an instructor has subject area(s), and a scheduled class draws both from class & instructor, so doesn’t need either.

(She did a bike trail site? Fun.)

Chewing on how to

Question about how/whether to use synonyms; she hasn’t used them, not sure how they work in practice.

Are there performance penalties for using CCK vs writing your own module? Might be faster, but harder to maintain. At what size site does it matter? Audience member answer, would have to be something damn huge (my words) for it to matter at all. Drupal.org uses CCK, handles the server load on the server end. Another audience member suggests that with shared hosting it might actually matter. Jennifer mentions caching, “turning off Views UI gives huge performance boost” and same with other unused modules. NWSource guy said their bottleneck was the database, everything is in CCK. And “so much easier”

CCK & custom modules can interact in weird ways, too.

[note for the gender-sensitive…I’m impressed at the balance here in attendees. I think Jennifer is the only woman presenting, but she is fantastic.]

DrupalCamp: drupal 101

Or 105, as the presenter says. (CivicActions)

He asked a bunch of questions about experience. Not covering installation.

As you as you go into that core file, just imagine me with a ruler smacking you on the wrists.

Document your code.

Civicactions.com/drupal_glossary – created to give to their clients


scale of modules that goes from very tiny to very big. CCK, Views & Panels are absolutely critical, can build almost anything with those.

taxonomy – makes Drupal powerful. taxonomy is the entire system of vocabularies: sets of terms. vs tagging/folksonomy? now you can set up a vocabulary that’s a free-tagging type, users get an auto-complete field to show the already-created terms but allow new terms on the fly. so…module Taxonomy Manager. πŸ™‚ how very drupal. heirarchical vs non.

(wrists hurt. gr.)

be cautious about hierarchical vocabs, too fancy = not used, at least with user-generated content.

in all cases: things build on each other. he’s working on a decision tree whether to use a taxonomy vs a custom field. wd be very interested to see that.

complex concept, which I missed part of: a blog entry about a restaurant that connects to a recipe, and it’s all about Chinese food. (ah, the “Chinese” part needing to be a vocabulary term to get the cross-associated stuff going.)

in many places category is used to mean term, vocabulary OR the whole taxonomy system. way confusing.

term -> vocabulary -> taxonomy

“admin menu” module. very clever. going into the permissions section & roles. you can also duplicate a role & then add on more permissions. (or remove? not sure.)

I wish I’d taken

Q: heard not to use user #1. is there a big reason? …other than being able to do anything accidentally? That would be the main reason. So user 1 should just set up the admin role, and then user(s) with the admin role do everything else. (some stuff about how they handle lots of different sites in a uniform way in their agency)

CCK. basic CCK, then modules for different types of content. (so is this where I’d get started with module-writing?)

Description…would be useful in an intranet?

(meta: is this session answering my questions? Maybe not. What are my questions? How could Drupal be used for an intranet? When the hell is D6 going to have all the modules I want? Also, he’s doing a lot of reading the screen.)

Restrict how many of each node type a user can create. Huh.

Use pipe character in list of allow values, then can change the labels as necessary still using a short value. I’m not sure I get the application, but it’s a clever concept.

Date vs datestamp? He doesn’t know the difference. (hm)

Sets all the date stuff early, because all the modules inherit that default, but can be changed individually.

Head screaming. Should’ve gotten coffee. Oh, while I’m drifting away from the presentation, this morning: just barely made my bus downtown, then when I got to the Oly transit center, realized that I forgot the laptop powercord & extension cord. (Also, I forgot my camera, but that’s less important.) Made a snap decision to go back home & get them, because not being able to take notes…well, those who read this know about how crazy-making that would be for me. Thought I could go home & catch the bus to get back downtown only a half-hour late. Saw the bus…leaving…as I was crossing the street to the stop. Walked downtown at near-top speed, probably about a mile, in the hopes of getting there in 15 minutes. Uh, no. (Darn close, though) But the bus was still there! Only, it wasn’t the 7:30 bus, but the 7:45. Apparently the 7:30 bus never ran or something. But after that, things went pretty smooth. Walked straight from Oly express to Seattle express, and just a couple of blocks from there to the W Seattle bus, and then across the street to here.

Image cache.

Theme layer vs configuring in the content type.

No recurrence in dates/times, which is apparently a long story.

drupalmodules.com vs. on the drupal site. best way to rate is to look at the issue queue, and if user # is under 1000, that’s a good sign. but drupalmodules has ratings. also has firefox search plugin.

Views – a query-building system. which nodes, what order, what fields from each node. Use the description well! Sign it if you have multiple people! Can easily have 30 views and not know which does which.

Argument is an advanced topic.

Whooboy that’s a huge list of filters.

Panels allows arranging views, nodes, etc. into more complex designs w/out themeing. (Session on that tomorrow.)