- Posts: 44
COMMUNITY FORUM
Item in a popup box - is this possible?
- gerald sisimayi
-
Topic Author
- Offline
- Senior Member
I want to make a grid of k2 items on 1 large page. I want it so that if they click on the thumbail of any item the item view will come out in a popup window (only a few custom fields and a pic on this view) which people can open and close.
Is such a thing possible?
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
Please Log in or Create an account to join the conversation.
- gerald sisimayi
-
Topic Author
- Offline
- Senior Member
- Posts: 44
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
Please Log in or Create an account to join the conversation.
- gerald sisimayi
-
Topic Author
- Offline
- Senior Member
- Posts: 44
Please Log in or Create an account to join the conversation.
- juju
-
- Offline
- Premium Member
- Posts: 119
function loaditem(item_id){
SqueezeBox.initialize();
SqueezeBox.fromElement(this, {
handler: 'iframe',
url: 'url_to_your_item',
size: {x:window.getSize().scrollSize.x-200, y: window.getSize().size.y-80},
onShow:$('sbox-window').setStyles({'padding': 2}),
});
}
For the url to the item, use the id of item, it's not hard to find... And for the size, I put automatic resize to the screen size of the user, and I remove 200px to width, and 80 to height, but you can do what you want ;)
Please Log in or Create an account to join the conversation.
- gerald sisimayi
-
Topic Author
- Offline
- Senior Member
- Posts: 44
Please Log in or Create an account to join the conversation.
- juju
-
- Offline
- Premium Member
- Posts: 119
joomla_folder\components\com_k2\templates\default\category_item.php
Read documentation of override (on this website, or on Simon website).
You just have to change the link of the image by a call to my fonction with the item id.
If nobody else help you with these indications, I'll be back on this topic at the end of the week ;)
Please Log in or Create an account to join the conversation.
- gerald sisimayi
-
Topic Author
- Offline
- Senior Member
- Posts: 44
I think I will wait for you, this is greek to me. If you are available sooner even better, I dont mind paying a small fee to you
Please Log in or Create an account to join the conversation.
- gerald sisimayi
-
Topic Author
- Offline
- Senior Member
- Posts: 44
Thanx
Please Log in or Create an account to join the conversation.
- juju
-
- Offline
- Premium Member
- Posts: 119
I actually work on a website for a client and I have a lot of work to do.
Anyway, I know how open a pop-up window with your article, maybe also create a minimal view with nonly few fields in this pop-up. But I need time, so I'll try to work on it tonight or tomorrow, but I don't garantee anything...
Please Log in or Create an account to join the conversation.
- gerald sisimayi
-
Topic Author
- Offline
- Senior Member
- Posts: 44
Please Log in or Create an account to join the conversation.
- Stephane ATTLANE
-
- Offline
- New Member
- Posts: 2
<a class="modal" href="<?php echo $this->item->link; ?>" > </a>
You put this code in category_item but you have to customize sqeleton.php to not display tpmenu, logo, ...
Please Log in or Create an account to join the conversation.
- gerald sisimayi
-
Topic Author
- Offline
- Senior Member
- Posts: 44
Please Log in or Create an account to join the conversation.
- Robin Nonnweiler
-
- Offline
- Junior Member
- Posts: 25
have you got a solution for the problem?
I also want to show my k2 items in a popup.
Would be really nice, if you have some information for me!
thanks
robin
Please Log in or Create an account to join the conversation.
- gerald sisimayi
-
Topic Author
- Offline
- Senior Member
- Posts: 44
Nope, no solution yet unfortunately. If anyone can help, please do!
Gem
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
<a href="<?php echo $this->item->link; ?>" title="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>"> <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>
And change to:
<a class="modal" rel="{handler:'iframe',size:{x:800,y:550}}" href="<?php echo $this->item->link; ?>&tmpl=component" title="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>"> <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>
Set "X" to satisfy your article content width.
You can do the same with Item Title.
In same file find:
<a href="<?php echo $this->item->link; ?>"> <?php echo $this->item->title; ?> </a>
and replace with:
<a class="modal" rel="{handler:'iframe',size:{x:800,y:550}}" href="<?php echo $this->item->link; ?>&tmpl=component"> <?php echo $this->item->title; ?> </a>
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
I haven´t tested it, guess it keeps styling.
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
- Robin Nonnweiler
-
- Offline
- Junior Member
- Posts: 25
thank you very much, works really nice!
But I have one little more question. If I use this method, the popup loads the whole page with menu,logo,other modules etc. I'm able to hide them with css, but the loading time is proportionally high, because he loads all the scripts, css etc. again.
Is there any way to load really just the item?
thanks a lot!
robin
Please Log in or Create an account to join the conversation.