Keyword

Open K2 Items in Modal (lightbox) window

  • David Brooks
  • David Brooks's Avatar Topic Author
  • Offline
  • New Member
More
12 years 5 months ago #65390 by David Brooks
Open K2 Items in Modal (lightbox) window was created by David Brooks
Hi all

I already have my site set up with the option of opening links in a modal window using class="modal" on the link. When I apply this to a link to a Joomla article the article opens in a lightbox window and loads in component view using the link index.php?tmpl=component&view=article&id=2 for example.

What I am trying to do is open K2 items in a modal window in component view. I have edited joomla/components/com_k2/templates/new_template/category_item.php so that the title link reads:
<a href="<?php echo $this->item->link; ?>"  class="modal" rel="{handler:'iframe',size:{x:990,y:550}}">

However, this doesn't open the item in component view so instead of just displaying the item in the lightbox I have the full page. I don't want the whole page to feature in the modal window, I just want the article.

If anyone knows how to do this or has a suggestion for a better way of solving this problem then please let me know. The problem lies with:
<?php echo $this->item->link; ?>
I don't know how to change this so that it refers to the component view instead.

Thank you

Please Log in or Create an account to join the conversation.

  • David Brooks
  • David Brooks's Avatar Topic Author
  • Offline
  • New Member
More
12 years 5 months ago #65391 by David Brooks
Replied by David Brooks on topic Re: Open K2 Items in Modal (lightbox) window
Fixed:

Replaced
<?php echo $this->item->link; ?>

With
<?php echo 'index.php?tmpl=component&option=com_k2&view=item&id='.$this->item->id.':'.$this->item->alias; ?>

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum