Keyword

Open item in lightbox

  • Nexus Star
  • Nexus Star's Avatar Topic Author
  • Offline
  • New Member
More
15 years 2 months ago #79026 by Nexus Star
Open item in lightbox was created by Nexus Star
I would like to make some of my item to be opened in lightbox.I made separate template override for one of my categories in K2 and made only images with pagination to be shown. I would like to be able when someone click on one of those images in lightbox to be shown only the item.Now I manage to make the whole page with the article to be opened in lightboxwhen adding: rel="{handler:'iframe',size:{x:300,y:300}}" just before href in image linkBut the problem with this is that it opens the whole web page navigated to this particular item.I am aware that I need to change the value of href in this link but how?If someone could help with this please?

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

More
15 years 2 months ago #79027 by Gobezu Sewu
Replied by Gobezu Sewu on topic Open item in lightbox
in addition to what you have done

1. if you don't already have it, drop the attached raw template in your template folder

2. in components\com_k2\models\item.php at row # 63 append '&tmpl=component' to the $link variable

that should do it
Attachments:

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

More
15 years 2 months ago #79028 by Simon Wells
Replied by Simon Wells on topic Open item in lightbox
Hi Gobezu,

You have asked for a file to be downloaded and a line of code to be changed, but you have not explained what the file is or why you need to do this.

For those that do not know, they could well be put off as they wont know what this is for.
Please could you explain.

Thanks.


Gobezu Sewu said:in addition to what you have done
1. if you don't already have it, drop the attached raw template in your template folder

2. in components\com_k2\models\item.php at row # 63 append '&tmpl=component' to the $link variable

that should do it

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

  • Nexus Star
  • Nexus Star's Avatar Topic Author
  • Offline
  • New Member
More
15 years 2 months ago #79029 by Nexus Star
Replied by Nexus Star on topic Open item in lightbox
Thank you so much
this do just what I am searching about for the past couple of days

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

More
15 years 2 months ago #79030 by Simon Wells
Replied by Simon Wells on topic Open item in lightbox
Can you explain to other users, what the download is please?

Nexus Star said:Thank you so much this do just what I am searching about for the past couple of days

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

More
15 years 2 months ago #79031 by Gobezu Sewu
Replied by Gobezu Sewu on topic Open item in lightbox
@K2Joom, I am sorry for being so cryptic and thank you for letting me know, partly it is b/c this damn forum that doesn't allow for any such kind of communication, as I actually never intended to attach a file rather include the code and do some explaining but was not able to submit my message...

Anyway the attached file is a so called raw template which simply leaves out all module and other calls and only includes component part as follows which if anyone who have opened a joomla template file would recognize is the call to the components content. That simple code along with the common don't call me if its not joomla internal line is saved as raw.php in the template folder which would facilitate the &tmpl=component override

More of this is discussed over here and here

lets see if i am able to submit this one now

K2Joom said:Can you explain to other users, what the download is please?
Nexus Star said:Thank you so much this do just what I am searching about for the past couple of days

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

More
15 years 2 months ago #79032 by Gobezu Sewu
Replied by Gobezu Sewu on topic Open item in lightbox
Simply frustrating, I am sorry but it seems to have discarded the code part so if you want to know those 2 lines you simply have to resort to downloading the file and have a look

Good luck

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

More
15 years 2 months ago #79033 by Simon Wells
Replied by Simon Wells on topic Open item in lightbox
Thanks ;)

Gobezu Sewu said:Simply frustrating, I am sorry but it seems to have discarded the code part so if you want to know those 2 lines you simply have to resort to downloading the file and have a look
Good luck

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

  • Nexus Star
  • Nexus Star's Avatar Topic Author
  • Offline
  • New Member
More
15 years 2 months ago #79034 by Nexus Star
Replied by Nexus Star on topic Open item in lightbox
I think that on my part could also explain what I achieved by this.
On the first try I saved the raw.php file in my custom template and append &tmpl=component
to link component in item.php file by adding the line $llink.='&tmpl=component'; just bellow 63 line.
But this lead all my read-more links to raw template resulting in displaying items striped by all other content.
So I made something else I made another template just for the category I want to look different and in there append
'&tmpl=component' just to the href link for images.
After changing configuration of joomla to SEF links I change the append to ?tmpl=component
You can see in attached images what I achieved by this - when someone clicks on image opens lightbox with item in it.
Please excuse the view of images but the site is still in development and again many thanks to Gobezu Sewu

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

More
15 years 2 months ago #79035 by Gastro Charlie
Replied by Gastro Charlie on topic Open item in lightbox
Hello Nexus ..
I've been trying and trying this hack for hours now but saddy can't get it to work. : |
Maybe you can help me?

I've followed these steps :

1. added rel="{handler:'iframe',size:{x:300,y:300}}" before href (in the components\com_k2\models\item.php file) is that the wrong file?

2. uploaded raw.php in my joomla template directory

3. added the line $llink.='&tmpl=component' just below line 63 in models\item.php

I suppose it's not working because of step 1. Could you confirm this .. or hlp me to get it working..

Thanks
Marco

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

  • Nexus Star
  • Nexus Star's Avatar Topic Author
  • Offline
  • New Member
More
15 years 1 month ago #79036 by Nexus Star
Replied by Nexus Star on topic Open item in lightbox
Gastro Charlie said:Hello Nexus ..


Hi Gastro sorry for such delay in replaying but been await for a while.
1. I added custom rewrite to K2 template in my own Template folder.
2. There in default template I put raw.php
3. In separate k2 template at category_item.php (in my case) I add ?tmpl=component
this is because I want category to display only pictures from items in this particular category.
I hope you can see clearly what I have done in attached picture.
Attachments:

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

More
14 years 11 months ago #79037 by Mats Arvendal
Replied by Mats Arvendal on topic Open item in lightbox
Hello,
I have searched for something like this, but I am sorry to say I can't get it to work. I tried the three steps above, but it only crashed the category view. All HTML was removed in the source except what was between:
< !-- Start K2 Category Layout -- > and < div class="itemContainer" style="width:100.0%;" >. Is it possible to ask anyone to explain a bit more in detail to all of us who need a "K2 for Dummies"?

Rgds

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

More
14 years 2 weeks ago #79038 by mvmdata
Replied by mvmdata on topic Open item in lightbox
Sorry for the necropost, but did you ever find a solution to this.

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

More
13 years 11 months ago #79039 by Drago
Replied by Drago on topic Open item in lightbox
What brought me here was that I was looking for how to make my gallery of photos open in lightbox and reading through this post helped me to figure out how to do it.

If you are looking for the result that Nexus Star has achieved, read through this discussion again and look at the screenshots provided, since it worked for me the first time I tried it. I myself am new to Joomla so I assume it should not be a big hassle.

If you want to make your category view images to open in lightbox instead of an iframe without the content as in Nexus' case, here is what you have to do. I have made 2 screenshots to illustrate my result.

1st go to components/com_k2/

2nd copy the templates folder

3rd go to your template and within the html folder create a folder named com_k2 (if you don't have an html folder in your template create it)

4th paste the templates folder in yourtemplate/html/com_k2/. Your directory tree should look like yourtemplate/html/com_k2/templates

5th within the templates folder create a new folder and name it whatever you want. This will be the template for your k2 category. In my case I called it photos.

6th open the default folder and copy all files from there into the new folder you just created.

7th open item.php and scroll to line 208 and modify it as in the screenshot below.

8th go to your k2 categories and select the template you created in step5. Once you refresh your browser it should work.

 

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


Powered by Kunena Forum