Show category image on article page
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
-
- Joomla! Apprentice
- Posts: 5
- Joined: Fri Jul 04, 2008 4:17 pm
Show category image on article page
We need to show the category image on article page, found a work around by not showing the intro text and placeing the category image at the top of the main text but then the article title shows above the image.
I have seen a much older post on this same topic with no reply's, I hope someone has an answer as I've been working on this for a week solid and lost two nights kip!
Thanks in advance
Jeff
I have seen a much older post on this same topic with no reply's, I hope someone has an answer as I've been working on this for a week solid and lost two nights kip!
Thanks in advance
Jeff
-
- Joomla! Apprentice
- Posts: 17
- Joined: Thu Mar 06, 2008 1:31 pm
Re: Show category image on article page
Hi there,
Sorry not to be posting a solution, but did you find any answer to this as I am trying to do exactly the same thing?
Thanks very much,
Alex.
Sorry not to be posting a solution, but did you find any answer to this as I am trying to do exactly the same thing?
Thanks very much,
Alex.
- lamis
- Joomla! Apprentice
- Posts: 11
- Joined: Tue Jul 01, 2008 11:19 am
Re: Show category image on article page
there isnt an exact solution but what I did was ( work only for front end though -still you can find the right file to make it work on all articles-)
this is NOT the best solution but thats what I did at least
1- Created new folder in media manager called it categories
2- upload pictures to that folder and name them the same as categories with jpg extension
3- went to templates/mycurrentTemplate/html/com_content/frontpage/default_item.php
4- added this
<img src="images/categories/<?= $this->item->category ?>.jpg">
this is NOT the best solution but thats what I did at least
1- Created new folder in media manager called it categories
2- upload pictures to that folder and name them the same as categories with jpg extension
3- went to templates/mycurrentTemplate/html/com_content/frontpage/default_item.php
4- added this
<img src="images/categories/<?= $this->item->category ?>.jpg">
-
- Joomla! Apprentice
- Posts: 13
- Joined: Tue Jun 23, 2009 7:31 pm
Re: Show category image on article page
hello, where in the php-file should i put in the code? Any specific line?
thanks
thanks
-
- Joomla! Apprentice
- Posts: 5
- Joined: Fri Mar 05, 2010 1:30 pm
- Contact:
Re: Show category image on article page
thanks for the tip!
www.iGetYouNews.com - Apple news from all over the web
-
- Joomla! Fledgling
- Posts: 2
- Joined: Sun May 30, 2010 5:46 am
Re: Show category image on article page
Check this extension.
It allows you to display a specific category description and/or image on a module position for corresponding articles (it can be set to do it automatically).
http://extensions.joomla.org/extensions ... I7fQ%3D%3D
It allows you to display a specific category description and/or image on a module position for corresponding articles (it can be set to do it automatically).
http://extensions.joomla.org/extensions ... I7fQ%3D%3D
-
- Joomla! Fledgling
- Posts: 3
- Joined: Sun Jul 25, 2010 5:01 pm
Re: Show category image on article page
Hi there... I got there by using this:
<img src="<?
$secid = $this->item->catid;
$this->section = & JTable::getInstance( 'category' );
$this->section->load( $secid );
$cparams = JComponentHelper::getParams ('com_media');
echo $cparams->get('image_path').'/'.$this->section->image;
?>">
Thanks for the module tip, I took a small code snipped from the module, looked through the joomla sources and finally found to this solution.
Lars
<img src="<?
$secid = $this->item->catid;
$this->section = & JTable::getInstance( 'category' );
$this->section->load( $secid );
$cparams = JComponentHelper::getParams ('com_media');
echo $cparams->get('image_path').'/'.$this->section->image;
?>">
Thanks for the module tip, I took a small code snipped from the module, looked through the joomla sources and finally found to this solution.
Lars
-
- Joomla! Apprentice
- Posts: 5
- Joined: Sat Oct 30, 2010 10:29 pm
- Location: Bari
- Contact:
Re: Show category image on article page
hello guys how can I use this module within the new article form (front end) ?
thanks
thanks
-
- Joomla! Fledgling
- Posts: 1
- Joined: Wed Dec 07, 2011 10:07 am
Re: Show category image on article page
in Joomla 1.6, to show the category image in an article, it should be
$secid = $this->item->catid;
$category = JCategories::getInstance('Content')->get($secid);
if ($category->getParams()->get('image')):?>
<img src="<?php echo $category->getParams()->get('image'); ?>"/>
<?php endif; ?>
$secid = $this->item->catid;
$category = JCategories::getInstance('Content')->get($secid);
if ($category->getParams()->get('image')):?>
<img src="<?php echo $category->getParams()->get('image'); ?>"/>
<?php endif; ?>
-
- Joomla! Fledgling
- Posts: 1
- Joined: Wed Dec 28, 2011 7:19 pm
Re: Show category image on article page
Good evening,
there is there a code to display the image of the category in the article for joomla 1.7 / 2.5?
Thank you in advance
there is there a code to display the image of the category in the article for joomla 1.7 / 2.5?
Thank you in advance
-
- Joomla! Fledgling
- Posts: 1
- Joined: Wed May 04, 2011 2:08 pm
Re: Show category image on article page
I would like the same in Joomla 1,7 does anyone know how to do this? thank you
-
- Joomla! Fledgling
- Posts: 2
- Joined: Tue May 26, 2009 8:11 pm
Re: Show category image on article page
use this code.. it works in 2.5 and 1.7
Code: Select all
<a href="<?php echo $this->item->category->link; ?>"><img alt="<?php echo $this->item->category->name; ?>" src="media/k2/categories/<?php echo $this->item->category->image; ?>" border="0"/></a>
- modernmagic
- Joomla! Explorer
- Posts: 386
- Joined: Mon Aug 10, 2009 3:58 pm
- Location: Laguna Beach, CA, USA
- Contact:
Re: Show category image on article page
Its great when you can use info from an old post and joomla version on the latest.
I used this to display the category image in an article:
I used this to display the category image in an article:
Code: Select all
<div class="catimage">
<?php
$secid = $this->item->catid;
$category = JCategories::getInstance('Content')->get($secid);
if ($category->getParams()->get('image')):?>
<img src="<?php echo $category->getParams()->get('image'); ?>"/>
<?php endif; ?>
</div>
Joomla! Website Designer http://www.modernmagic.com
Joomla! User Group Leadership Team http://www.ocjoomlausergroup.org/
Joomla! User Group Leadership Team http://www.ocjoomlausergroup.org/