By tordrup on
Hi there,
I've built a couple of simple drupal sites, but now I have to build a site with a deeper information architecture, and I'm stuck on something....
I understand how to promote a piece of content to the homepage, but what about promoting to a "section" page?
For example, I want a page called "Success Stories" that includes:
- A CMS-controlled introduction, and
- 2. Lists of links to two content types -- case studies and customer testimonials.
I feel like this should be a simple task, and (believe it or not) I've googled it for a couple of hours. It must be a basic drupal concept or function that I'm not understanding.
Thanks in advance for any guidance or references you can provide.
All the best,
Dave
Comments
Taxonomy + Views
First, create a vocabulary that is mapped to your content types. In that vocabulary, create a term "Success stories." Categorize all of your success stories as such. That gets you 99 percent of the way there, since the taxonomy system supports a list view page for each term.
Since you also want a "CMS-controlled introduction" and separate clusters for two content types, install the Views module. With the Views module, you can create all sorts of interesting presentations, and it's trivial to create one that is filtered by term+published status and includes an introductory paragraph. It shouldn't be hard to get to what you want.
Here's an example that's not quite what you're looking for, but is accomplished using similar techniques:
http://www.myclaysun.com/staffblogs
It looks pretty much like the generic /blog page, but is built with a simple Views query: published blogs written by users whose roles include "staff." Notice the page label and explanation at the top.
perfect!
Thanks so much yelvington- you saved me hours of trial and error
How about sharing
How about sharing the technique in more detail in a handbook page. Many people would be interested in this. As many people say that Views is great, it's strange that I've never gotten it to do what I want.
Nancy W.
now running 5 sites on Drupal so far
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in Your Database
NancyDru
How to use views in a page
Hi again,
Ok I've set up my vocabulary, and created a view that shows both content types on the same page, including a header. Beautiful!
On the page, I'd like to separate my two content types visually (and semantically). I'm guessing I need to create two views as blocks. Is this correct?
If so, I guess my main view (which combines the two content types) will no longer be useful. What's the best way to get the CMS-controlled header, and my two separate block views, on a single page? My first inclination is to create a page node and embed each view by hand with PHP -- but perhaps there's a better way?
Thanks again for your help,
Dave
Views block references in nodes
Probably the simple way is to use Views to create views as blocks, then embed the references directly in the body of a node, using PHP. To do that, you're going to have to read the Views documentation, which is best found by opening up the views.module file and scanning through to the very heavily commented function definition for views_build_view(). You'll wind up doing something like this:
You also can use this technique to combine several block views into a single block, et cetera.