In this post i would like to explain about how to add image in joomla for each article sidebar. If we want to add some categories or articles images for sidebar of joomla website. Just cutomize the joomla code and implement it by simple code.

how to add image in joomla for each article sidebar | Anil Labs
In the admin we have to place the below code in the file
\administrator\components\com_content\admin.content.html.php
Search for below code
After this we have add below code
<tr valign="top">
<td>Category Image</td>
<td><input type="file" id="file-upload-entete" name="FileCategory" /></td>
<td><img src='<?php echo JURI::base(); ?>../images/<?php echo $row->id; ?>/category.jpg' width=50 height=50 border=0></td>
<td><input type="checkbox" name="delCategory"> </td>
</tr>
</table>
We have upload the images at the file
\administrator\components\com_content\controller.php
Search for below code
After this line of code add in that page
mkdir("../images/".$row->id); // Create folder for this article
move_uploaded_file($_FILES['FileCategory']['tmp_name'],"../images/".$row->id."/category.jpg");
}
In the front-end we have to get the image of particular article id and display it in the sidebar
Just open the file which is located at
templates\[YOUR TEMPLATE NAME]\html\com_content\article\default.php
Search for the below code
After this code add the below code:
In the sidebar we can write own syyles to display our category images… by below code
if (file_exists($sEncartPath))
{
?>
<img src="images/<?php echo $this->article->id;?>/category.jpg" width="256" height="220">
<?php
}
?>
Hope this will be useful.
it is for 1.5 , isn’t it ?
Hi
Where i can find this file in Joomla 2.5??
Please let me know i realy want this to work ..
Nice tutorial,, must know guide for joomla developers..