Posted by Kato on February 11, 2006 at 12:27pm
I have been looking and I can't seem to find something that would suit my needs. I can't see why it can't be done, I'm just not sure if it HAS been done before or not.
If you look at this site, etoychest.org, scroll down to the bottom of the page. There is a "More" links down there with a brief heading of several of the last articles posted. This site I am referring too was done with Joomla. Does Drupal have a feature like that where you can get your last 5 or 10 articles to show up as little links like that at the bottom?
Comments
hhmm.
Even if this was in a block, that would work for me. Does anyone have a module hidden away somewhere that does this exact same thing? Drupal comes with a most recent comment and most popular, but I want a most recent page/story box/link. I hope someone has some magic somewhere to do this.
-------------------------------------------------------
http://gamersides.com
http://ngl.gamersides.com
php snippets
What you want is to use the "front page" module, and create a custom front page with a php snippet at the end that lists the titles of the next x posts with links. I had a site that used to do this. I'll see if I can find and post the specific php snippet I used.
That would be awesome
If you could find that php snippet, I would be very much appreciated. I'll look in to the front page module and see if that is what I am looking for.
-------------------------------------------------------
http://gamersides.com
http://ngl.gamersides.com
Front Page isn't good...
After reviewing what all Front Page can do and how it works on a test Drupal installation, I'm not so sure this is what I want. I really don't want to change the front page for any user. The front page is just fine, I just want to add a spot that lists the last 5 pages/stories added to the site.
Anyone else know how to do this? Will that phpsnippet you were talking about do this?
-------------------------------------------------------
http://gamersides.com
http://ngl.gamersides.com
To do that you need to use a
To do that you need to use a php snippet...which requires you to use front page. You can keep the "normal" front page and just add the snippets to it.
check this thread
http://drupal.org/node/24638
That's where I posted a similar problem and eventually was able to figure it out. I'm still trying to find the specific code I used in my front page setting.
Trying out a block...
As I really don't want to change the frontpage or even redirect or anything of the sort. A block will work just as well that displays the information I want. There is a block snippet to display the latest stories. I don't know php...so maybe someone can tell me what I need to change to make this work. I copy and paste it in to a block, but nothing shows.
<?php// ---- copy from here ---
// latest.module v0.1.0, John Clift, 11 Dec 2003
// Module displays a block which lists the titles, linked,
// of the last five stories to be added or modified
// Database query to get the latest story nodes
// $nlimit sets the number of node titles to display
function latest_nodes($type) {
$nlimit = 5;
$result = db_query("SELECT n.created, n.title, n.nid, n.changed
FROM node n
WHERE n.type = '$type'
ORDER BY n.changed
DESC LIMIT $nlimit");
while ($node = db_fetch_object($result)) {
$output .= l(check_output($node->title), "node/view/".$node->nid) ."<br>";
}
return $output;
}
// Function to display titles of latest story nodes in a block
function latest_block($op = "list", $delta = 0) {
if ($op == "list") {
$blocks[0]["info"] = t("Latest n Additions or Changes");
return $blocks;
}
else {
$block["subject"] = t("Latest Changes");
$block["content"] = latest_nodes("story");
return $block;
}
}
// --- end ---
?>
I did try to change the "$type" to "story" in the two places it is referenced. That made the block show up, but it had errors in it.
Parse error: parse error, unexpected T_STRING, expecting ')' in /home/kato/public_html/drupal/includes/common.inc(1813) : eval()'d code on line 8What am I doing wrong and why won't this block snippet work?
-------------------------------------------------------
http://gamersides.com
http://ngl.gamersides.com
views module
If you have the views module, you can go to administer->site building->views and you'll see a frontpage view in the list.
Click 'add' to override it, and you can set for example how many items to display, the pager to use, whether to create a block also which contains a list of recent news stories, etc.
http://twitter.com/edtechdev
http://edtechdev.wordpress.com/