- Posts: 37
COMMUNITY FORUM
Image Caption
- Eyal Kattan
- Topic Author
- Offline
- Junior Member
Antbody knows how can I add the caption of an Item's image to the Item Listing View In Category?
It looks like the caption can be set for Item View but not for Item View In Category Listing
Any help would be greatly appreciated
Thanks
Eyal Kattan
Owner
MEDIA NEXUS INC
Please Log in or Create an account to join the conversation.
- Andrey Miasoedov
- Offline
- Senior Member
I just checked it and all work fine, alt attribute is setted in category listing and item page as well.
Please Log in or Create an account to join the conversation.
- Eyal Kattan
- Topic Author
- Offline
- Junior Member
- Posts: 37
Andrey Miasoedov wrote: Hello, Eyal.
I just checked it and all work fine, alt attribute is setted in category listing and item page as well.
Hi Andrey,
My apologies but I must be still wasted from new year's eve :)
I attached 2 images: one of the "Item View Options In Category Listing" that shows no image caption settings and the second screenshot of the "Image View Options" that does include caption settings.
My version is:
(Last update: December 9th, 2011 - Version 2.5.4)
Am I missing anything?
Thanks,
Eyal
Eyal Kattan
Owner
MEDIA NEXUS INC
Please Log in or Create an account to join the conversation.
- Jakub Jedynak
- Offline
- Senior Member
- Posts: 56
1. in templates change code for image display in 'category_item.php' - just copy 'captions/credits' part from 'item.php'
2. make sure you have in category options 'display captions/credits' set to yes (or it won't work)
Hope it helps :-)
Please Log in or Create an account to join the conversation.
- Eyal Kattan
- Topic Author
- Offline
- Junior Member
- Posts: 37
Jakub Jedynak wrote: I not sure it will work, but:
1. in templates change code for image display in 'category_item.php' - just copy 'captions/credits' part from 'item.php'
2. make sure you have in category options 'display captions/credits' set to yes (or it won't work)
Hope it helps :-)
Just to make sure.. this is under Administrator templates right?
Eyal Kattan
Owner
MEDIA NEXUS INC
Please Log in or Create an account to join the conversation.
- Jakub Jedynak
- Offline
- Senior Member
- Posts: 56
The best way is to COPY default k2 templates (default folder and it's content) from:
components > com_k2 > templates > default
to:
templates > NAME OF FRONTEND USED TEMPLATE > html > com_k2 > templates > default
and then in this folder open and edit mentioned in previous post 'php' files.
You can make in this way different layouts and use it in different parts of the site (choosing it lalter in category options) - just clone 'default' folder under new name and change in the files what you want (knowing of basic 'php/html' required).
Files in template (edit if you want change layout of the article):
item.php - view and content of the full article
category_item.php - view and content of the article on the category list
Please Log in or Create an account to join the conversation.
- Eyal Kattan
- Topic Author
- Offline
- Junior Member
- Posts: 37
I assume, alignment of the caption etc... is set in my site template? I used this line of code for the caption:
<?php if($this->item->params->get('itemImageMainCaption') && !empty($this->item->image_caption)): ?>
<!-- Image caption -->
<div class="catItemImageCaption"><?php echo $this->item->image_caption; ?>
</div>
<?php endif; ?>
so I guess I need to create a CSS class named catItemImageCaption and tweak it as I need?
Thanks
Eyal
Eyal Kattan
Owner
MEDIA NEXUS INC
Please Log in or Create an account to join the conversation.
- Jakub Jedynak
- Offline
- Senior Member
- Posts: 56
Eyal wrote: AWESOME! Now I'm starting to understand how powerful Joomla+K2 are. Thanks so much for your reply.. it worked like a charm.
Yes it is very powerful after some tweaks ;-)
Eyal wrote: so I guess I need to create a CSS class named catItemImageCaption and tweak it as I need?
Yes.
Eyal wrote: Thanks
You welcome ;-)
Please Log in or Create an account to join the conversation.