26 October 2007 - 07:23 (where I live) support@drupal.org
Hello support,
I'm developing a site using the Abac theme and would like to publish short (say, 3-4 sentences) 'headlines' in the left sidebar. These headlines wouldn't relate to any other story/page.
I can't work out how to do this. Is there a module that does this or can it be done with the basic installation?
Many thanks.
Quoting The Janitor thejanitor@fastmail.fm:
26 October 2007 - 07:23 (where I live) support@drupal.org
Hello support,
I'm developing a site using the Abac theme and would like to publish short (say, 3-4 sentences) 'headlines' in the left sidebar. These headlines wouldn't relate to any other story/page.
I can't work out how to do this. Is there a module that does this or can it be done with the basic installation?
This http://drupal.org/project/views will probably do it.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
Quoting The Janitor thejanitor@fastmail.fm:
26 October 2007 - 07:23 (where I live) support@drupal.org
Hello support,
I'm developing a site using the Abac theme and would like to publish short (say, 3-4 sentences) 'headlines' in the left sidebar. These headlines wouldn't relate to any other story/page.
I can't work out how to do this. Is there a module that does this or can it be done with the basic installation?
Add a content type e.g. Headlines Add a block e.g. Headlines
For the Block body choose the php input filter Add something like
<code> <?php $res = db_query("SELECT title, nid FROM {node_revisions}"); $output=null; while ($data = db_fetch_object($res)) { $output .= l($data->title, 'node/'.$data->nid) . '<br/>'; } return $output; ?> </code>
You'll need to adjust the db_query to include a left join on the {node} table selecting only node_revisions that have a node.type of e.g. headlines.
Earnie -- http://for-my-kids.com/ -- http://give-me-an-offer.com/
If you want to be *really* basic about it with no modules, you could just create a block and paste your content directly into it (/admin/build/block/add).
I think you'd be much better off creating a Headline node type and using Views as Earnie suggested, however, as it's much cleaner to manage. Alternatively, you can look at something like the Quotes module (http://drupal.org/project/quotes).
Brian
The Janitor wrote:
26 October 2007 - 07:23 (where I live) support@drupal.org
Hello support,
I'm developing a site using the Abac theme and would like to publish short (say, 3-4 sentences) 'headlines' in the left sidebar. These headlines wouldn't relate to any other story/page.
I can't work out how to do this. Is there a module that does this or can it be done with the basic installation?
Many thanks.
31 October 2007 - 06:53 (where I live)
Hi guys
Thanks for the suggestions - I'll look into them.
Sorry for the delay in replying, I've just returned from a short holiday.
02 November 2007 - 07:20 (where I live)
Hi all
Thanks for the help on this guys.
Before I started to investigate the methods suggested, a thought occured to me: "Could I use the 'blog' module?" After all, a blog is really just a list of 'news' items.
It works well (in my case only one person can have a blog, which is what I want).
Blog entries are 'published' but not 'promoted to front page'.
The 'Recent blog posts' block appears in the left sidebar (floated to the top) and renamed 'Latest News'. It means the user clicking a link to the news item rather than reading it directly but I can live with that.
Are there any problems with this approach that I've missed?
There are two cosmetic issues I'd like some help with:
I'd like to limit the number of items (i.e. recent blog posts) shown to less than 10 (the default) and I'd like the link to the "author's blog" link not to be shown. I suspect that these will involve changing some code somewhere. Any clues?
Many thanks for your help.