- Posts: 8
COMMUNITY FORUM
K2 Image to image gallery instead of enlarge
- Kyle Vasquez
-
Topic Author
- Offline
- New Member
Less
More
11 years 1 week ago - 11 years 1 week ago #128235
by Kyle Vasquez
K2 Image to image gallery instead of enlarge was created by Kyle Vasquez
Thank you so much in advance!
I have a template over ride, I just don't know what exactly to change to make it pull up the image gallery.. IF it is possible.. Instead of the image in the lightbox..
Basically I want ALL of the images to appear for that image gallery and not just the one image and then they have to sort or go through the gallery
<?php if($this->item->params->get('itemImage') && !empty($this->item->image)): ?>
<!-- Item Image -->
<div class="itemImageBlock">
<span class="itemImage">
<a class="modal" href="<?php echo $this->item->imageXLarge; ?>" title="<?php echo JText::_('Click to preview image'); ?>">
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
</a>
</span>
I have a template over ride, I just don't know what exactly to change to make it pull up the image gallery.. IF it is possible.. Instead of the image in the lightbox..
Basically I want ALL of the images to appear for that image gallery and not just the one image and then they have to sort or go through the gallery
<?php if($this->item->params->get('itemImage') && !empty($this->item->image)): ?>
<!-- Item Image -->
<div class="itemImageBlock">
<span class="itemImage">
<a class="modal" href="<?php echo $this->item->imageXLarge; ?>" title="<?php echo JText::_('Click to preview image'); ?>">
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
</a>
</span>
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 1 week ago #128236
by Lefteris
Replied by Lefteris on topic Re: K2 Image to image gallery instead of enlarge
Hi. The K2 image gallery is printed by the following code:
You can just move this code in the top of the item.php file where you want it to be displayed.
<?php if($this->item->params->get('itemImageGallery') && !empty($this->item->gallery)): ?>
<!-- Item image gallery -->
<a name="itemImageGalleryAnchor" id="itemImageGalleryAnchor"></a>
<div class="itemImageGallery">
<h3><?php echo JText::_('K2_IMAGE_GALLERY'); ?></h3>
<?php echo $this->item->gallery; ?>
</div>
<?php endif; ?>
You can just move this code in the top of the item.php file where you want it to be displayed.
Please Log in or Create an account to join the conversation.
- Kyle Vasquez
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 8
11 years 1 week ago #128237
by Kyle Vasquez
Replied by Kyle Vasquez on topic Re: K2 Image to image gallery instead of enlarge
How would I replace it tho? I have replaced the module code but it doesn't do anything to the K2 Item..
Thank you so much by the way!
Thank you so much by the way!
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 1 week ago #128238
by Lefteris
Replied by Lefteris on topic Re: K2 Image to image gallery instead of enlarge
You need to clarify. Are you talking about a module or a component menu link? The example i gave you can be applied to the item page of K2. Probably you need to first read getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates to get familiar with K2 templates.
Please Log in or Create an account to join the conversation.
- Kyle Vasquez
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 8
11 years 1 week ago #128239
by Kyle Vasquez
Replied by Kyle Vasquez on topic Re: K2 Image to image gallery instead of enlarge
I replace the code for the image with the code for the image gallery and nothing happens.. it just stays the same, I am asking cause I don't know what I am missing!
<a class="modal" href="<?php echo $this->item->imageXLarge; ?>" title="<?php echo JText::_('Click to preview image'); ?>">
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
</a>
is the code I replaced.. is there something else I need to do?
<a class="modal" href="<?php echo $this->item->imageXLarge; ?>" title="<?php echo JText::_('Click to preview image'); ?>">
<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
</a>
is the code I replaced.. is there something else I need to do?
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 1 week ago #128240
by Lefteris
Replied by Lefteris on topic Re: K2 Image to image gallery instead of enlarge
In which file? Your site may be using overrides and that's why you don't see the changes.
Please Log in or Create an account to join the conversation.