- Posts: 12
COMMUNITY FORUM
Open item in lightbox
- Nexus Star
-
Topic Author
- Offline
- New Member
Please Log in or Create an account to join the conversation.
- Gobezu Sewu
-
- Offline
- Senior Member
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.
- Simon Wells
-
- Offline
- Platinum Member
- Posts: 955
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
-
Topic Author
- Offline
- New Member
- Posts: 12
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.
- Simon Wells
-
- Offline
- Platinum Member
- Posts: 955
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.
- Gobezu Sewu
-
- Offline
- Senior Member
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.
- Gobezu Sewu
-
- Offline
- Senior Member
Good luck
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
- Posts: 955
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
-
Topic Author
- Offline
- New Member
- Posts: 12
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.
- Gastro Charlie
-
- Offline
- New Member
- Posts: 1
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
-
Topic Author
- Offline
- New Member
- Posts: 12
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.
Please Log in or Create an account to join the conversation.
- Mats Arvendal
-
- Offline
- Premium Member
- Posts: 147
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.
- mvmdata
-
- Offline
- New Member
- Posts: 4
Please Log in or Create an account to join the conversation.
- Drago
-
- Offline
- New Member
- Posts: 2
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.