So far, my team and I have created a CCK content type that contains the following fields:
- First name
- Last name
- Job title
- Head shot
- Office Hours
- Phone
- Location
- Website(s)
- Bio/description
Once you're in the view editing screen, ( /admin/build/views/edit/{viewname} ), you have to do a few things to get started. These steps are pretty much true for any view you create...
- Set a couple of filters, especially the 'public or admin' filter, plus one for the specific content type that you are creating a list for.
There may be other filters depending on what your view is meant to accomplish...in my case, filtering for published/admin and for content type were sufficient. - In the Basic settings box, choose whether you want your view's row style to be a set of fields, or full node. Node-based views will run through the Drupal theme layer and respect any theming you've done for that content type. In my case, I want to theme them specifically, so I choose 'node'.
- Also under Basic settings, you can select how many items should be on the list, whether to use pagination controls, header and footer text, etc.
- Next, I made a new display for my view - a page display that can be visited at a specific URL on my site. Once added, choose a path for your page view under Page options and set any specific sorting or additional filter criteria that you might want this page to have.
Display-specific sorting, filters, or other settings can be set as overrides to the default view, or they can update the entire view. Think about how specific you need to be, and if there will be multiple displays of this view with different filters, sorting, etc. that need specific overrides.
*Update*
After posting this yesterday, I did a few other things:
- I used the ImageCache module to resize images as they're uploaded to generate thumbnails or other form factors as appropriate for the theme
- I themed the view by using a node-view-viewname.tpl.php file, where viewname is the name of my view. my view was called node-view-PeopleDirectory.tpl.php.
Important tip: This works whether or not you're in 'node' or 'fields' display type. It appears that the node-whatever supersedes the views tpl files to some extent. More research needed on this... - I themed the content type a little bit using node-person.tpl.php
- Last, I used the features module to package the content type, view, and ImageCache presets into a tarball that can be reused across sites. I imported it into another development site I was working on, and the content type came in fine, but the view did not. Guess I'll have to try again Monday to see what I did wrong.
No comments:
Post a Comment