Hi,
I have seen a number of blogs where a related articles section was below every entry. As far as I found out there is nothing similar for Serendipity. So here is the first release of a plugin I wrote.
The plugin uses the tags created by the freetags plugin to connect articles to each other. If two articles have common tags then they classify as related. So if you publish an article tagged as 'Foo' and 'Bar' then other entries with either the tag 'Foo' or 'Bar' are candidates to be shown in the list. Entries that have the tags 'Foo' and 'Bar' are even more likely to be shown. The is a configuration option to limit the number of links to show.
I thought about using the entry category as well but haven't implemented that yet.
A word of caution: this is the first time I created a plugin, so I'm not sure if this is working in all cases. Especially the way the plugin generates the output (by adding code to $eventData['display_dat']) might not be the proper way. I wanted to have the output between the entry and trackbacks/comments and this gave the best results. I'm using a custom template so there might be issues with the template as well.
Download: serendipity_event_related.zip
Comments and fixes by s9y hackers welcome!
Regards,
Stefan
Related Entries Plugin
Related Entries Plugin
If Java had true garbage collection, most programs would delete themselves upon execution. (Robert Sewell)
-
Don Chambers
- Regular
- Posts: 3657
- Joined: Mon Feb 13, 2006 2:40 am
- Location: Chicago, IL, USA
- Contact:
Re: Related Entries Plugin
The freetag plugin already has an option to display related entries.
=Don=
Re: Related Entries Plugin
Now this is embarrassing...
The formatting is not exactly what I want but I'll start playing with CSS for that. Sorry...
If Java had true garbage collection, most programs would delete themselves upon execution. (Robert Sewell)
Re: Related Entries Plugin
Recent versions of that plugin have an option to customize the emitted HTML code.Cenic wrote:The formatting is not exactly what I want
YL
Re: Related Entries Plugin
It works. With a change to my entries.tpl I was able to display the list of tags and the related links in different places of the page.
Thanks,
Stefan
Thanks,
Stefan
If Java had true garbage collection, most programs would delete themselves upon execution. (Robert Sewell)
Re: Related Entries Plugin
Good to hear that 
Don't be too disappointed you oversaw the existing functionality, your plugin seems like quite a solid work, it should help you when you build the next one.
If you have a look at the freetag-plugin (and there at the function addRelatedEntries), you could compare how the output is done there (via addfooter or as extension to eventData[$entry]).
Don't be too disappointed you oversaw the existing functionality, your plugin seems like quite a solid work, it should help you when you build the next one.
If you have a look at the freetag-plugin (and there at the function addRelatedEntries), you could compare how the output is done there (via addfooter or as extension to eventData[$entry]).