Loading...
 
Skip to main content

Features / Usability


Displaying module on custom home page

I would like to have a home page that displays all the most recent posts from any source (or at least, from Forums, Articles and Blogs).

I'm thinking that the module since_last_visit_new might be what I am looking for.

I found a code snippet in http://tikiwiki.org/tiki-view_forum_thread.php?forumId=4&comments_parentId=5751&highlight=modules%20parameter%20pageQuestion that looks like it might do the job, other than being several years old. The code snippet is:

$phpfile = 'modules/mod-last_blog_posts.php';
$template = 'modules/mod-last_blog_posts.tpl';
include($phpfile);

if (file_exists('templates/' . $template)) {
$data = $smarty->fetch($template);
} else {
$data = '';
}

So my questions are:

1) Is having a module as custom home page the best way to create a home page that displays recent posts?

2) is the the module since_last_visit_new the best way to do this? If not, what would work better?

3) If yes, Will that code snippet still work after all these years? If it won't work, how should it be coded?

As you may have gathered, I'm not a coder guy so thanks for any help you can give.

Why not just use the since_last_visit_new module, as it is, in a wiki home page? You can override the module dimensions if it's displaying as a narrow box, if necessary (some themes have css that makes all modules, say, 180px wide; others allow them to go full-width in a wiki page).

-- Gary


Unfortunately, I already have a wiki home page. I would prefer to keep it as is. Maybe when I figure out how to get tikiwiki running on my home computer (Apache and MySQL settings throw me for a loop) I will try the code snippet above to see if I can make it work as a custom home page.

Thanks for the suggestion, though.