Page 1 of 1

Lightbox style view of pages at admin area

Posted: Wed Aug 06, 2008 10:49 am
by KO
I wanted to open pages on lightbox style window when clicking "magnifier class" button on right side of page listing and it seemed quite simple to do. Here it is if you interested to do the same.

I used Lytebox to do that as it handles also normal html pages. It's a standalone js file and does not depend on any libraries. You can find it at http://www.dolem.com/lytebox/

1. I downloaded latest 3.22 zip files and unpacked them to /lib/lytebox directory.

2. Open defaultTheme.php on /admin/themes/default directory (if you use some other theme look for right *Theme.php at you theme directory) and add following lines around line 132.

Code: Select all

echo '<__script__ type="text/javascript" src="../lib/lytebox/lytebox.js"></__script>';
echo '<link rel="stylesheet" href="../lib/lytebox/lytebox.css" type="text/css" media="screen" />';
3. Open listcontent.php on /admin directory and around line 767 change line from

Code: Select all

 $thelist .= "<td class=\"pagepos\"><a href=\"".$url."\" rel=\"external\">";
to

Code: Select all

$thelist .= '<td class="pagepos"><a href="'.$url.'" rel="lyteframe" rev="width: 1000px; height: 600px;" target="_blank">';
Alter width and height to your needs and check lytebox homepage for more settings.

Now you can try it. Your pages should open nicely to a lightbox style window.

You could do same for page edit window "magnifier class" by opening editcontent.php in /admin directory. Edit line around 524

Code: Select all

   $submit_buttons .= ' <a rel="external" href="'.$contentobj->GetURL().'">'.$themeObject->DisplayImage('icons/system/view.gif',lang('view_page'),'','','systemicon').'</a>';
to

Code: Select all

$submit_buttons .= ' <a href="'.$contentobj->GetURL().'" rel="lyteframe" rev="width: 1000px; height: 600px;" target="_blank">'.$themeObject->DisplayImage('icons/system/view.gif',lang('view_page'),'','','systemicon').'</a>';
I hope it works for you also.

Re: Lightbox style view of pages at admin area

Posted: Thu Aug 14, 2008 6:34 am
by hexdj
Nice guide!  :D