While working on a new template for Pligg I was trying to come up with the best way to manage articles that would appear on top of the homepage to feature select stories. I originally was thinking that I could use the "Groups" feature for Pligg, or even create a "Featured" category. Then I thought that those methods would not allow me to appropriately label my news and were not the best way to handle the featured news articles that I wanted on the homepage. That's when I turned to CMStheme's
Featurify module, which allows admins to manually set up images that link to news article and rotate those images somewhere in your template. A few hours later I had created a "Featured" module for Pligg.
How it works
The first thing you will need to do is upload and install the module. Then add a snippet of code to the template file where you want the featured news to appear. You can do this by adding the following line to a .tpl file:
I suggest that you place it on your homepage by placing it in index_center.tpl and wrapping it with the following code so that it only shows up on the homepage and not the second, third, etc. pages.
Code:
{if $pagename == 'index' && count($templatelite.get) == 0}{$featured}{/if}
The Featured module has a nearly identical admin interface to the Featurify module. Admins can log in to the admin area and then navigate to a page where it displays your current featured news items. If you want to remove a news item you can easily edit or delete it, or if you don't have any you can click on the button to "Add Featured News". See the attached screenshots for examples.
The module is set to only grab the latest 4 news items from your Featured News list. The most recent item will be used to display the first news article with a larger image, while the second, third and fourth most recent article appear with a smaller thumbnail.
The template file used for this module ( /modules/featured/templates/featured.tpl ) has been designed to work with the new
Arthemia Pligg template. If you are using another template you will want to customize this file to make it look better in your own template. You can also make some small tweaks to the file to change how many stories you want to appear, how many characters the smaller stories get in their descriptions before being cut off and other cosmetic changes.
Lastly, make sure that you CHMOD 0777 the /modules/featured/phpthumb/cache/ directory to ensure that thumbnails are able to be added to that folder.
Credits
CMStheme for his
Featurify module.
phpthumb for generating and caching image thumbnails