Active
Project:
Lightbox2
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
28 Jul 2011 at 12:01 UTC
Updated:
22 Jul 2022 at 10:51 UTC
Jump to comment: Most recent
Comments
Comment #1
Anonymous (not verified) commentedI think the problem can be broken down into 2 questions:
1) Shouldn't the template be "page--node--lightbox2.tpl.php" instead of "page-node-lightbox2.tpl.php"?
2) How can I make sure that the template is called at all? Should I add something to the template.php?
Comment #2
ckuepker commentedSubscribe.
I have the same problem that Lightbox2 displays nodes with all standard blocks (menus, ..) around it when linked via href="node/123/lightbox2" like described in the documentation [for D5 and 6]. Is this a bug inside the module 7.x-dev or is it me, not doing it right? Didn't try out that - or -- template file naming stuff. Will try that tomorrow but I hope for further assistance here.
Edit: Tried renaming of the above mentioned template file to -- name but file seems to be used never. I then looked into the module code of
lightbox2.moduleand probably found the responsible lines of code starting from line 1199function lightbox2_preprocess_page(..). Looks like its trying to remove all regions, except the one called 'content'. Through simple debugging I found out, that the index 'content' isn't defined here (at least using default D7 theme). Nevertheless the regions don't get removed although this function definitely is called when trying to view a node in lightbox. I know nearly nothing about hooks and preprocessing therefore I don't know what could be done to fix this. Hoping for further investigation by the maintainers.Comment #3
yukare commentedAs said in #2, it is broken, so change to bug report.
To be honest, until now i did look at this.
Comment #4
ckuepker commentedOkay I found something that made it work for me. I tried with the page-node-lightbox2.tpl.php from modules directory again. Copied it to my theme folder and renamed it to -- instead of -. What I saw then, was a white screen (no content loaded at all but head and body are being created as they should) inside my Lightbox. Thats better than nothing but not what I needed.
So I tried around a bit. Copied the page.tpl.php from my theme and renamed it to page--node--lightbox2.tpl.php. That actually did the trick. By removing line after line of unwanted output I finally achieved the simple node content. Only disturbing thing is the remaining Administration Menu. But at least, I'll be the only one that sees it.
Since my last comment I switched from standard theme to Zen but I think it should work with any theme.
Nevertheless the bug remains as the mentioned function in lightbox2.module should do all the work for me :)
Comment #5
sorensong commented@ckuepker #4 worked perfectly!
Comment #6
yukare commentedCan you post the template here? I can look on removing the admin menu if is necessary and use it as the default template in lightbox.
Comment #7
ckuepker commentedWell there you have it:
But remember that this one is from Zen.
Edit: I think the admin menu (the module which replaces the toolbar on top of the page) is inserted via JavaScript so it might not be that easily removed on a single path. At least I don't know how I could do that.
Comment #8
mariotux commented@ckuepker #4 worked perfectly!
Comment #9
sondes commentedThe approach in #4 works great! Thanks! Remember to append "/lightbox2" to the end of node links. Otherwise, the custom template will not be used.
Comment #10
sreekanth1201 commentedWhere we need to append that "/lightbox2" . in view ..?
Comment #11
ckuepker commentedIt must be appended to the links href-attribute that should open the content in a lightbox. In views you can do that by using field display and then rewriting the output of the field that creates the link. Should be possible by using the views UI.
Comment #12
laraz commentedI have omega theme and this haven't got page.tpl.php... How can I do?
Anybody have this problem?
thanks.
-------------