Lightbox style view of pages at admin area

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Lightbox style view of pages at admin area

Post 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.
hexdj
Power Poster
Power Poster
Posts: 415
Joined: Sat Mar 24, 2007 8:28 am

Re: Lightbox style view of pages at admin area

Post by hexdj »

Nice guide!  :D
Post Reply

Return to “Tips and Tricks”