roknewspagerAny Joomla based site that hosts a fair amount of articles should have a FrontPage module to suggest articles to site guests.  There are many such modules out there but I like the way RocketTheme's RokNewsPager displays and the many configurable options it provides.  I don't like that it doesn't offer article randomization...but we're going to fix that!

 

As mentioned, one of the options RokNewsPager does NOT provide is to randomize the article order.  It can list articles by ascending, descending, ID, recent or oldest, alphabeticilly or reverse alphabetical...but not random.  The problem with the lack of a random list option is that you are always serving your guests either recent or old content with little chance of cycling articles, that may fall somewhere in the middle, to the forefront.

It is possible to enable random article ordering by applying a small modification to one of the module's files.  The file we are looking for is the "helper.php" file that resides in the module's folder.

You can find this file by either opening your host CPanel or your FTP client.

Go to your site's Root folder.  There you will see a folder titled "Modules".

syncit.14

Double-click to open.  Scroll down to the folder titled "mod_roknewspager" and open it.

syncit.15

Inside the "mod_roknewspager" folder, open the "lib" folder.  The "helper.php" file should be there.

syncit.16

syncit.17

Download it and open it up in your favorite editor.  Scroll down to the section titled "//ordering" (roughly a third of the way down).

syncit.12

Replace all the "$orderby" values to "RAND()" like so:

syncit.13

Save the file then upload and overwrite the original on your server.  As usual, when modifying a plugin, module or component file, it is always wise to save the original with a "bk_" prefix to allow you to revert if something breaks.

There you have it!  If you did everything correctly, your articles should now be served in random order.

Thanks for reading!

Tags:     joomla      rockettheme      roknewspager      rok module      rockettheme modules      random article order      random ordering      rt      hack module

Brought to you by dodisdodat.com! All Rights Reserved © 2010-2011!

ad_logo



blog comments powered by Disqus


Share This Article! Share This Article!

Follow Us

facebook-128twitter-128youtube-128rss-128

Contact Us

Do you have any questions, suggestions, requests or simply want to leave us some feedback?
Send us a quick message!