Loading...
 
Skip to main content

Features / Usability


"last 10 articles" module: possible?

Hi,

I'd like to have a module listing, say, the last 10 articles in a given
topic.

I've not been able to discover any obvious facility for this. I trid
creating an RSS module linking to the 'Articles' RSS feed on the same site -
not exactly what I want, since I only want one topic, but I tried anyway -
and the web server went into a tailspin requesting RSS feeds from itself,
loading my modest server (64MB) heavily enough to have apache processes
dying left, right and centre.

I suspect there is a 'proper' way to do this, which operates via an internal
PHP call and is much more efficient. However, I can't find anything
documenting such a feature, and the tikiwiki site has examples of 'last 10
posts of forum X' and 'latest modified wiki pages', but no article lists.

Surely I'm missing something?

Thanks,

Nick

ps i'm using v1.7.1.1 -Eta Carinae on Debian linux 'Woody' stable

Well! A resounding silence to that question. Is that because nobody knows, or everybody knows but doesn't care to reply to such a dull question?

Anyway - I didn't find a way to do it with tikiwiki as it is, however I added a module which seems to do the trick.

Those of you who are interested, here is how.

Create a file 'mod-last_articles.tpl' in templates/modules/, and another called 'mod-last_articles.php' in modules/.

...I was going to paste them verbatim in here, but I'm afraid I don't know how to do that ... if it's possible.. sorry. I've attached them instead (concatenated into once file, becase I apparently can't submit more than one file!).

Now a 'last_articles' module should appear in your predefined list of modules in the Modules admin page. You can set the list to display only one topic with the topicId= parameter, where is the id number of the topic. You can also set the title of the module with the title= parameter. (Join parameters with ampersands, like an http query). I've not really sussed what the type parameter is for, I found it in the code I cut and pasted, and left it in.