- Posts: 404
COMMUNITY FORUM
Image Gallery in Tag Layout
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
Less
More
13 years 1 month ago - 13 years 1 month ago #63096
by Odin Mayland
Image Gallery in Tag Layout was created by Odin Mayland
I have some k2-items that do not have an k2-image. They only have images in the K2-item "Image Gallery" tab.
Is it possible to have the image gallery thumbnail displayed in the tag layout view and have the image gallery pop up in a modal window instead of linking to the k2-item?
I was able to accomplish this in the category view by added the code commented with "<!-- START: Display Image Gallery in category list-->"
Is it possible to have the image gallery thumbnail displayed in the tag layout view and have the image gallery pop up in a modal window instead of linking to the k2-item?
I was able to accomplish this in the category view by added the code commented with "<!-- START: Display Image Gallery in category list-->"
Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
Less
More
- Posts: 6227
13 years 1 month ago #63097
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic Re: Image Gallery in Tag Layout
Retrieve the image gallery by entering $item->gallery inside the foreach loop (in tag.php). Make sure that SIGP has single thumb mode enabled.
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 404
12 years 11 months ago #63098
by Odin Mayland
Replied by Odin Mayland on topic Re: Image Gallery in Tag Layout
Wow, I messed up and didn't see your reply.
I am using tag.php @version $Id: tag.php 1286 2011-10-27 17:37:15Z
I see the foreach on line 37 <?php foreach($this->items as $item): ?>
I have tried adding $item->gallery in various ways but it keeps giving me a blank white page on the tag layout.
Can you paste in the code that I should place in my tag.php? Or just paste it into your own tag.php and upload the file?
I am using tag.php @version $Id: tag.php 1286 2011-10-27 17:37:15Z
I see the foreach on line 37 <?php foreach($this->items as $item): ?>
I have tried adding $item->gallery in various ways but it keeps giving me a blank white page on the tag layout.
Can you paste in the code that I should place in my tag.php? Or just paste it into your own tag.php and upload the file?
Please Log in or Create an account to join the conversation.
- matthew turner
-
- Offline
- Senior Member
Less
More
- Posts: 66
12 years 11 months ago #63099
by matthew turner
Replied by matthew turner on topic Re: Image Gallery in Tag Layout
Hi Modernmagic,
Try this...
Change the Root folder for image galleries in Simple Gallery Pro plugin settings to:
media/k2/galleries/
In the Tag.php template file call the gallery with this:
<?php if($item->params->get('catItemImageGallery') && !empty($item->gallery)): ?>
<?php echo JHTML::_('content.prepare', $item->gallery ); ?>
<?php endif; ?>
Hope the above helps..
Regards
Mat
PS
I did post this on the old K2 site and now its gone I had to remember which clients site I had used it on for you !!
Try this...
Change the Root folder for image galleries in Simple Gallery Pro plugin settings to:
media/k2/galleries/
In the Tag.php template file call the gallery with this:
<?php if($item->params->get('catItemImageGallery') && !empty($item->gallery)): ?>
<?php echo JHTML::_('content.prepare', $item->gallery ); ?>
<?php endif; ?>
Hope the above helps..
Regards
Mat
PS
I did post this on the old K2 site and now its gone I had to remember which clients site I had used it on for you !!
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 404
12 years 11 months ago - 12 years 11 months ago #63100
by Odin Mayland
Replied by Odin Mayland on topic Re: Image Gallery in Tag Layout
If I change the SIGPro plugin settings to media/k2/galleries/ will that only affect existing Image galleries that used the {gallery}myphotos{/gallery} syntax?
Right now all the image galleries were uploaded through the K2 Item Image Gallery Tab so they are already here: /media/k2/galleries/
P.S. that pretty funny about the "new notification system." :-)
Right now all the image galleries were uploaded through the K2 Item Image Gallery Tab so they are already here: /media/k2/galleries/
P.S. that pretty funny about the "new notification system." :-)
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 404
12 years 11 months ago #63101
by Odin Mayland
Replied by Odin Mayland on topic Re: Image Gallery in Tag Layout
That code worked!
The only difference was that the SIGPro root was without the end "/": media/k2/galleries
Thanks again Mat.
The only difference was that the SIGPro root was without the end "/": media/k2/galleries
Thanks again Mat.
Please Log in or Create an account to join the conversation.
- matthew turner
-
- Offline
- Senior Member
Less
More
- Posts: 66
12 years 11 months ago - 12 years 11 months ago #63102
by matthew turner
Replied by matthew turner on topic Re: Image Gallery in Tag Layout
Hi Jeff,
Glad it helped!
Oh and whoops sorry about the extra '/' !
I had a think after your previous post and decided to find a way to leave the plugin root folder in its default settings...
In case you do need to leave the plugin default root of images/stories (if you are using galleryPro elsewhere with non k2 item galleries) you can change the plugin params inside your tag.php template override file:
$params =& $mainframe->getParams('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 );
The content.prepare bit seems to use the plugin's settings and not the k2 root folder overrides (which I now know are hard coded in to the core k2 code!)
Regards
Mat
Glad it helped!
Oh and whoops sorry about the extra '/' !
I had a think after your previous post and decided to find a way to leave the plugin root folder in its default settings...
In case you do need to leave the plugin default root of images/stories (if you are using galleryPro elsewhere with non k2 item galleries) you can change the plugin params inside your tag.php template override file:
$params =& $mainframe->getParams('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 );
The content.prepare bit seems to use the plugin's settings and not the k2 root folder overrides (which I now know are hard coded in to the core k2 code!)
Regards
Mat
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 404
12 years 1 month ago - 12 years 1 month ago #63103
by Odin Mayland
Replied by Odin Mayland on topic Re: Image Gallery in Tag Layout
Mat,
I have the same issue trying to get the Gallery to appear in a K2 Content module. Can you check out this thread?
getk2.org/community/New-to-K2-Ask-here-first/142213-How-to-show-gallery-with-single-thumbnail-inside-K2-Content-module#170360
Thanks
Jeff
I have the same issue trying to get the Gallery to appear in a K2 Content module. Can you check out this thread?
getk2.org/community/New-to-K2-Ask-here-first/142213-How-to-show-gallery-with-single-thumbnail-inside-K2-Content-module#170360
Thanks
Jeff
Please Log in or Create an account to join the conversation.
- matthew turner
-
- Offline
- Senior Member
Less
More
- Posts: 66
12 years 1 month ago - 12 years 1 month ago #63104
by matthew turner
Replied by matthew turner on topic Re: Image Gallery in Tag Layout
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.