- Posts: 50
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- How to show gallery with single thumbnail inside K2 Content module
How to show gallery with single thumbnail inside K2 Content module
- esedic
-
Topic Author
- Offline
- Senior Member
Less
More
14 years 11 months ago #83732
by esedic
How to show gallery with single thumbnail inside K2 Content module was created by esedic
I thought I found a solution to my problem described in this topic: community.getk2.org/forum/topics/how-is-item-image-md5-hash (shortly: importing/assigning large number of images) since I used gallery functionality to display images in the catalog, because gallery data is stored in the database. I did this by batch compressing images, batch extracting zip files to subdirectories and uploading all the folders to the server in the media/k2/galleries folder. And of course in the end with inserting data in the database: {gallery}folder_name{/gallery}.But of course it didn't quite work out since I want to use K2 Content module to display certain products on certain pages and this module doesn't have option to display gallery, but to display images only.Naively and simply I tried to put <?php echo $this->item->gallery; ?> inside modules/mod_k2_content/tmpl/Default/default.php, but it doesn't work.Can anybody tell me, which files need to be changed for this to work?Any functions or plugins need to be triggered before?I added params option in the mod_k2_content.xml.Probably helper.php needs to be modified.Thanks for helping.
Please Log in or Create an account to join the conversation.
- natecovington
-
- Offline
- Senior Member
Less
More
- Posts: 68
14 years 2 months ago #83733
by natecovington
Replied by natecovington on topic How to show gallery with single thumbnail inside K2 Content module
Also looking for a solution to this for a client project. I'll be taking a look into the code in a few days and will report back if I find a solution.
Please Log in or Create an account to join the conversation.
- Steve Tustin
-
- Offline
- Junior Member
Less
More
- Posts: 29
13 years 10 months ago #83734
by Steve Tustin
Replied by Steve Tustin on topic How to show gallery with single thumbnail inside K2 Content module
Did you find a solution short of just adding the {gallery}XX{/gallery} to the intro text?
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
- Offline
- Platinum Member
Less
More
- Posts: 404
12 years 2 months ago #83735
by Odin Mayland
Replied by Odin Mayland on topic Re: How to show gallery with single thumbnail inside K2 Content module
Has anyone ever figured this out?
I have successfully used the following to get the Gallery to appear in the category view but this does not work when pasted into mod_k2_content/tmpl/Default/default.php
I have successfully used the following to get the Gallery to appear in the category view but this does not work when pasted into mod_k2_content/tmpl/Default/default.php
Log in or Create an account to join the conversation.
- Odin Mayland
-
- Offline
- Platinum Member
Less
More
- Posts: 404
12 years 2 months ago #83736
by Odin Mayland
Replied by Odin Mayland on topic Re: How to show gallery with single thumbnail inside K2 Content module
I have also tried this in mod_k2_content/tmpl/Default/default.php but it only displays the first k2item on a blank white page.
Log in or Create an account to join the conversation.
- matthew turner
-
- Offline
- Senior Member
Less
More
- Posts: 66
12 years 2 months ago #83737
by matthew turner
Replied by matthew turner on topic Re: How to show gallery with single thumbnail inside K2 Content module
Hi Jeff,
Just found your post via twitter as they still have not added a following/subscribe option to posts that we have posted on (unless I've missed something!)
I did not realise this was no longer working and have just revisited my original posted code and adapted it to work.... I have added extra code so that you can leave the simple galley plugin folder settings left to default so it can be used outside of k2, oh and added option to switch single thumb on or off .
<?php
$app = &JFactory::getApplication();
$params = $app->getParams();
$parameter_get_value= $params->get( 'jw_sigpro' );
$params->set('galleries_rootfolder', 'media/k2/galleries');// galleries_rootfolder left on 'images/stories' default in plugin
$params->set('singlethumbmode', '0');// single thumb off - just an example!
echo JHTML::_('content.prepare', $item->gallery, $params );
?>
Again hope you see this post, and that it helps (I will reply this on both!).
Regards
Mat
Just found your post via twitter as they still have not added a following/subscribe option to posts that we have posted on (unless I've missed something!)
I did not realise this was no longer working and have just revisited my original posted code and adapted it to work.... I have added extra code so that you can leave the simple galley plugin folder settings left to default so it can be used outside of k2, oh and added option to switch single thumb on or off .
<?php
$app = &JFactory::getApplication();
$params = $app->getParams();
$parameter_get_value= $params->get( 'jw_sigpro' );
$params->set('galleries_rootfolder', 'media/k2/galleries');// galleries_rootfolder left on 'images/stories' default in plugin
$params->set('singlethumbmode', '0');// single thumb off - just an example!
echo JHTML::_('content.prepare', $item->gallery, $params );
?>
Again hope you see this post, and that it helps (I will reply this on both!).
Regards
Mat
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
- Offline
- Platinum Member
Less
More
- Posts: 404
12 years 2 months ago - 12 years 2 months ago #83738
by Odin Mayland
Replied by Odin Mayland on topic Re: How to show gallery with single thumbnail inside K2 Content module
Mat,
Glad you found this.
I have pasted your code into templates/ja_t3_blank/html/mod_k2_content/nolink/default.php
No matter where I past it, the view only shows 1 of the items that do not have an image gallery.
Here is the normal view with all K2 items showing. The ones with titles only are the ones with only Imagegalleries.
Here is what happens when I past your code in:
1. The image gallery thumbnails are cropped.
2. They do not have titles
3. Only the first K2item with an itemImage shows.
If I click on the cropped thumbnail, the image gallery modal works perfectly:
So the issues are titles, and getting the other itemImages to still show.
Here is the default.php file that is not working for me:
Thanks for all your help,
Jeff
Glad you found this.
I have pasted your code into templates/ja_t3_blank/html/mod_k2_content/nolink/default.php
No matter where I past it, the view only shows 1 of the items that do not have an image gallery.
Here is the normal view with all K2 items showing. The ones with titles only are the ones with only Imagegalleries.
Attachment not found
Here is what happens when I past your code in:
Attachment not found
1. The image gallery thumbnails are cropped.
2. They do not have titles
3. Only the first K2item with an itemImage shows.
If I click on the cropped thumbnail, the image gallery modal works perfectly:
Attachment not found
So the issues are titles, and getting the other itemImages to still show.
Here is the default.php file that is not working for me:
Attachment not found
Thanks for all your help,
Jeff
Please Log in or Create an account to join the conversation.
- matthew turner
-
- Offline
- Senior Member
Less
More
- Posts: 66
12 years 2 months ago #83739
by matthew turner
Replied by matthew turner on topic Re: How to show gallery with single thumbnail inside K2 Content module
Hi Jeff,
I'm not sure whats going wrong for you there but I am more than happy to look at your file for you....
I tried downloading your attached file (default.php.zip ) but I keep getting a 500 error
Please repost it and I will have a look.
Regards
Mat
PS
Just noticed a Subscribe box under this very form (Check this box to be notified of replies to this topic.- yay!!) - I dont remember seeing that when I last posted? !!
I'm not sure whats going wrong for you there but I am more than happy to look at your file for you....
I tried downloading your attached file (default.php.zip ) but I keep getting a 500 error
Please repost it and I will have a look.
Regards
Mat
PS
Just noticed a Subscribe box under this very form (Check this box to be notified of replies to this topic.- yay!!) - I dont remember seeing that when I last posted? !!
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
- Offline
- Platinum Member
Less
More
- Posts: 404
12 years 1 month ago #83740
by Odin Mayland
Replied by Odin Mayland on topic Re: How to show gallery with single thumbnail inside K2 Content module
Thanks for looking into this!
I have attached the file from templates/ja_t3_blank/html/mod_k2_content/nolink/default.php
I have attached the file from templates/ja_t3_blank/html/mod_k2_content/nolink/default.php
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- How to show gallery with single thumbnail inside K2 Content module