Highlighting registered only articles

This brief article will tell you how to make highlights on registered access only article content similar to the default highlighting found on unpublished articles when a user is logged in. It covers Joomla 2.5.x.

This is not so important if your articles are not mixed together with differing permissions groups. Recently however I was asked to create a visual representation of both unpublished and registered article states for the logged in user. The paradigm was unconventional in that we want to use "Registered" as a type of hint that this article is "Pending". Starting from scratch an administrator/webmaster would be better off creating this access type from the beginning before applying the following technique.

You will need to create an override of the blog.php file found at /components/com_content/views/category/tmpl/blog.php if using a category blog layout. You will need to use a different view to target the required effect at that layer.

Copy the blog.php file to /templates/your_template/html/com_content/category/blog.php and edit this file, not the one at the original location. This will preserve your changes when upgrading Joomla.

Find the two lines in blog.php where you see the following reference (you can do a file search):

echo $this->loadTemplate('item');

And change them to look like the following:

if($item->access > 1){ echo "
";} echo $this->loadTemplate('item'); if($item->access > 1){ echo "

If you refresh your test page nothing will happen as we have yet to manipulate the style sheet (CSS). Edit your main template file, usually found at /templates/your_template/css/template.css and add the following at the bottom:

#members {
  background:    none repeat scroll 0 0 #E8EDF1;
  border-bottom: 4px solid #C4D3DF;
  border-top:    4px solid #C4D3DF;
#members h2:after {
  content:       " - Registered";
  font-style:    italic;

Try it out by changing a category blog article to unpublished, then published but registered, then both unpublished and registered to see the overlay effect. Make adjustments to colours and border sizes until you get the desired effect.

Hope this helps someone.

Share on Myspace

Shopping cart

Your cart is empty.

Latest News

CHMOD file only in subdirectory

[FYI] Do this...

Start with directories if you are changing them for the web server first, this will change files too:

$ find images -type d -exec chmod 755 {} +

Then run it again to change files, with the different switch:

$ find images -type f -exec chmod 644 {} +

I recommend adding a recursive (-R) switch along with a verbose output (-v):

$ find images -type f -exec chmod -Rv 644 {} +

You may need to use super permissions to action this. Be warned, this can lock you out.

Joomla 3 - Add language file support for plugins

Do this...

* Load the language file on instantiation.
* @var    boolean
* @since  3.1
protected $autoloadLanguage = true;

Generic domains names now available

Here's a full list of "Generic" domain names you probably never thought were available (register at http://hosting.noxidsoft.com):

Login Form