Displaying Author Alias in Joomla’s Article / Content

As a popular CMS, Joomla can be used to serve various purpose sites, from simple news management to sophisticated e-commerce with CRM functionalities. Now, consider yourself as a smart publisher who instead of burning your skin chasing for a hot article about kitten’s birth, decides to automate the process and let user submit their favorite news and article to your site.

You choose Joomla because it’s simple and easy to manage. Later you pick JA Submit, a content submission component available for free download at http://www.joomlart.com/downloads/ cat/free_joomla_extensions/ja_submit_2.1.html and after installing, configuring the component and put the link at your site, you’re done. Really?

As a good man who appreciate intellectual property, you acknowledge an obligation to display article’s author on each contribution. You look at the form provided by JA Submit and find a field which points to author’s name. You feel at ease. Now you try to make sure it works. You submit an article about UFO landing on a very vast grass field and put your manish space name as the author. The submit button is clicked and then you try to read the article since you auto approve article submitted by non registered user.

Surprisingly, your name is not there. You do a recheck by going to the admin panel. Strangely, you find your name is not there. What’s wrong?

Actually, it’s something to deal with joomla core, not JA Submit. Basically, JA Submit works by inserting data to content tables which is later displayed by com_content. If you’re comfortable with editing php files, you can tweak com_content to set name alias as the top priority.

To do so, please follow these steps successively. After all’s done, make a page refresh and see if it shows the effect desired.

1. Go to components/com_content folder

2. Open content.html.php

3. Find this tag:

function Author(…

4. Change the function into

	/**
	* Writes Author name
	*/
	function Author( &$row, &$params ) {
		if ( ( $params->get( 'author' ) ) && ( $row->author != '' ) ) {
			?>
			<tr>
				<td width="70%" align="left" valign="top" colspan="2">
					<span class="small">
						<?php echo _WRITTEN_BY . ' '.( $row->created_by_alias ? $row->created_by_alias : $row->author ); ?>
					</span>
					&nbsp;&nbsp;
				</td>
			</tr>
			<?php
		}
	}

It’s so simple and now you won’t be sued for copyright infringement.

5 Responses to “Displaying Author Alias in Joomla’s Article / Content”


  • Will this work with Community Builder (i.e. when one clicks on the author, assuming they are a registered user, will this take the view to the author’s CB profile page)???

  • hi,
    what you want to achieve is different with the purpose of this hack. this hack is mainly used to show the name unregistered user (which is by default won’t be displayed) to reflect the name written into created_by_alias field in jos_content.

    this hack is initially made to comply with JA Submit content submission component from Joomlart.

  • Happened to see this while browsing, but I don’t know why all this is for since Joomla accepts and displays Alias w/o the help of any extension.

    Secondly, my components/com_content folder doesn’t have a file named content.html.php.

  • @shillog
    I think you use Joomla 1.5. This article may not be fit for Joomla 1.5. I also cannot verify for the most recent Joomla 1.0 since I’ve been away from fiddling with Joomla for more than a while.

Leave a Reply