I've done a lot of reading, and previously posted a much more complex set of questions here http://drupal.org/node/258969, which is probably why there was no response :-), so I'm making this one short and sweet:
Here are the ways AFAIK that I can display a page with more than one node, as opposed to a single page at a time linked via menus - out of the box:
- the default /node page
- taxonomy display pages
Is that it?
As far as the next thing to try, everyone seems to agree contrib Views module is the way to go.
Any other ideas? (Remember: noob perspective!)
Not kvetching, but I have to ask (OK OK I know it wasn't just one question, so consider this optional ;-) if the above is all true, why wouldn't Views have made it into core by now?
Thanks in advance for your help
Comments
As views as matured modules
As views as matured modules that output their own list (as with the taxonomy module) seem to be switching to views I think in part because it given the developer more control over the list. So yes, one should consider using views for making lists of nodes.
Blogs also
Well, if you're using the blogs module, then you've got the 'blog' page and the blog/%uid page.
--
-john
--
-john
Also: http://drupal.org/proje
Also:
http://drupal.org/project/get_content_type
http://drupal.org/project/node_type_filter
and you can always write your own SQL query to get the listing you want ...
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
"List of nodes" = teasers, graphics?
Thanks to all who've replied
Is the concept of a "list of nodes" like a simple one-line per node listing of titles?
The default front page (/node) view shows more than this, with a contributor-controlled length of teaser text, possibly a thumbnail image (haven't checked this out yet).
The latter is what I'm going for here, so I'd appreciate learning if all of these have the same capacity for customizing the display.
And no, I won't be writing my own SQL queries for the moment, thanks
Yes, node listings generally
Yes, node listings generally includ title + teaser. Views is the only thing I know that produces title-only listings.
You may also want to have a look at http://drupal.org/project/contemplate to help with themeing the output.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
contemplate
Hi Hans,
try out contemplate to control the look/feel ....
-- Sree --
IRC Nick: sreeveturi
Simplelist also provides you
Simplelist also provides you with title-only listings, but it's only for Drupal 6.
--
-john
--
-john
Custom SQL query for a node listing
>you can always write your own SQL query to get the listing you want ...
OK I'll bite, where would the query go?
And I do want teasers, not just listings - can Views output be customised to show more than just the one-row listings?
Assuming I'm not getting into Contemplate just yet. . .
Views will output its
Views will output its listings as complete nodes, teasers, a list, or a table.
>where would the query go
In a PHP input format page you could start with the code from the top of this function: http://api.drupal.org/api/function/node_page_default/5 - and then add additional conditions to the WHERE clause in the actual query to get the set of results you want (and perhaps get rid of the n.promote = 1 condition).
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
just to clarify
Thanks a lot for your help!
Just to clarify, your second paragraph isn't related to Views right, these are two separate alternatives to getting what I'm after?
Assuming that's the case, then let me paraphrase to see if I got it:
Create a new Page, selecting the PHP input filter. Copy and paste the code you pointed to, then refine the WHERE clause to get the listing.
Going to this location will then generate a page view that will be a node list in the content area, contained within the header/sidebar/footer framework generated by my theme/templates.
All good so far? Now assuming just simple core Menu navigation, let me "close the loop" from a noob POV: give this node a path that matches a menu item's path.
I see this is the code that core uses to generate the default front page, what shows when I go to /node correct? If so, do I need to change anything to prevent conflicts with that, e.g. the name of the node_page_default function?
And finally, how can I look for examples of how to express these conditions, e.g. based on node type or taxonomy term, sticky or not, etc, e.g. is this a particular type of snippet?
You have it in one
To make this page the front page just give it a URL alias of your choice (path module) and then set this to be the front page in your main site settings admin screen. You might even be able to override the path 'node'.
To get some ideas for the WHERE clause, look at the syntax of the existing one and look at the structure of the {node} table. So you could add conditions such as AND n.type = 'story'. The completed page might look something like:
If you want taxonomy filtering (i.e. to pull out only nodes which have certain taxonomy terms) you need to do a JOIN, replace the first line by something like this:
In this example, xx, yy and zz would be 3 taxonomy term ids you wanted to pull out the nodes for. I cribbed this from http://api.drupal.org/api/function/taxonomy_select_nodes/5; you might even be able to call this function directly if you can get it to select the nodes you want. This function http://api.drupal.org/api/function/taxonomy_term_page/5 is what produces the default taxonomy/term/tt listings.
Note also that (for no particular reason!) the first example above only SELECTed nodes that had been 'promoted', where as the more complex query immediately above doesn't include that restriction (though it could of course).
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk