It is currently Fri Sep 05, 2008 4:25 pm

Content Preview (lightbox) Function

General questions relating to Joomla! 1.5 There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.

Content Preview (lightbox) Function

Postby wildorchid on Wed Aug 01, 2007 5:38 pm

I love the way Joomla 1.5 displays the content preview in the lightbox.

My question is if I can use this function also on the frontpage instead of normal popup window for example to show a larger image when clicking on a thumbnail included in the page content.

I noticed that there are some extensions for Joomla 1.xx but if Joomla 1.5 has this possibility natively included maybe there is a way to make use of it on the frontpage too?

Anyone has accomplished this or knows where to look?

Thanks for your help.
wildorchid
Joomla! Apprentice
Joomla! Apprentice
 
Posts: 14
Joined: Sun Feb 18, 2007 9:11 am

Re: Content Preview (lightbox) Function

Postby AMCAD on Wed Aug 01, 2007 5:51 pm

wildorchid wrote:I love the way Joomla 1.5 displays the content preview in the lightbox.

My question is if I can use this function also on the frontpage instead of normal popup window for example to show a larger image when clicking on a thumbnail included in the page content.

I noticed that there are some extensions for Joomla 1.xx but if Joomla 1.5 has this possibility natively included maybe there is a way to make use of it on the frontpage too?

Anyone has accomplished this or knows where to look?

Thanks for your help.


Hey wildorchid,
I went to the actual Lightbox2 site (http://www.huddletogether.com/projects/lightbox2/) and got the code from there. I downloaded the files and followed everything step-by-step. Put the links to the different JavaScript files directly into your index.php (i put them at the end of the Head section).

This will enable all pictures to be viewed in lightbox as long as you link the thumbnail to a larger picture and put
Code: Select all
<rel="lightbox">
in your tag. So like
Code: Select all
<a rel="lightbox" href=''></a>


Good luck!
AMCAD
Joomla! Intern
Joomla! Intern
 
Posts: 79
Joined: Thu Jun 07, 2007 2:16 pm

Re: Content Preview (lightbox) Function

Postby wildorchid on Thu Aug 02, 2007 5:33 am

AMCAD wrote:
Hey wildorchid,
I went to the actual Lightbox2 site (http://www.huddletogether.com/projects/lightbox2/) and got the code from there. I downloaded the files and followed everything step-by-step. Put the links to the different JavaScript files directly into your index.php (i put them at the end of the Head section).

This will enable all pictures to be viewed in lightbox as long as you link the thumbnail to a larger picture and put
Code: Select all
<rel="lightbox">
in your tag. So like
Code: Select all
<a rel="lightbox" href=''></a>


Good luck!


Hi AMCAD,

I believe you that this works however my question was if this can be accomplished with the already built in function from Joomla 1.5. If you look at in the admin section where you add or edit content there is a preview button which creates a lightbox preview page.

Do you know what I mean? If a native Joomla 1.5 function can be used to do this it is better than having to hack the system with an external script because of future upgrades to the site.

I think they do it with the mootools.js which is now a part of Joomla 1.5.

I found the following called Slimbox http://www.digitalia.be/software/slimbox#downloadwhich is also using the mootools.js. It is similar to the Lightbox but makes use of native mootols.

Any other idea?
wildorchid
Joomla! Apprentice
Joomla! Apprentice
 
Posts: 14
Joined: Sun Feb 18, 2007 9:11 am

Re: Content Preview (lightbox) Function

Postby wildorchid on Sat Aug 04, 2007 10:22 am

I believe the functions for generating lightbox/squeezbox are in the modal.js and make use of mootools. However I don't know how to use them.

Anybody can help?

Thanks
wildorchid
Joomla! Apprentice
Joomla! Apprentice
 
Posts: 14
Joined: Sun Feb 18, 2007 9:11 am

Re: Content Preview (lightbox) Function

Postby wildorchid on Sun Aug 05, 2007 9:28 am

wildorchid wrote:I love the way Joomla 1.5 displays the content preview in the lightbox.

My question is if I can use this function also on the frontpage instead of normal popup window for example to show a larger image when clicking on a thumbnail included in the page content.

I noticed that there are some extensions for Joomla 1.xx but if Joomla 1.5 has this possibility natively included maybe there is a way to make use of it on the frontpage too?

Anyone has accomplished this or knows where to look?

Thanks for your help.


I finally was able to use the Joomla 1.5 native Lightbox which is called the SueezeBox on the frontpage to display images and also external HTML in an iframe Lightbox.

You need to include media/js/modal.js and media/js/modal.css into the header tags in the index.php of your template.
Code: Select all
<script type="text/javascript" src="media/system/js/modal.js"></script>

Code: Select all
link rel="stylesheet" href="media/system/css/modal.css" type="text/css" />

Next you need to include the following little Javascript to initiate the SqueezeBox:
Code: Select all
<script type="text/javascript">
    // <!--

      window.addEvent('domready', function() {

         SqueezeBox.initialize({});

         $$('a.modal').each(function(el) {
            el.addEvent('click', function(e) {
               new Event(e).stop();
               SqueezeBox.fromElement(el);
            });
         });
      });
    // -->
  </script>


Finally to call this Squeezebox for an image use:
Code: Select all
<a [color=red]rel="SqueezeBox"[/color] href="yourimagefolder/yourimage.jpg" title="Your Image Title" [color=red]class="modal"[/color]><img src="yourimagefolder/yourthumbimage.jpg" alt="Imagename" title="Your Image Title"  </a>


To call an HTML page into an iframe use:
Code: Select all
<a rel="{handler: 'iframe', size: {x: 800, y: 600}}" href="http://www.domain.com/page.html" class="modal">Testlink</a>


No guarantee that above is 100% correct but it works for me. However if only images need to be displayed in a Lightbox I prefer the script Slimbox from http://www.digitalia.be. Both Modal and Slimbox seem to be Lightbox2 clones but Slimbox is a smaller and very fast loading Lightbox script that shows the caption of the image plus has additional functionality to display image groups with next-previous buttons. Both make use of the Mootools Framework.

Cheers
wildorchid
Joomla! Apprentice
Joomla! Apprentice
 
Posts: 14
Joined: Sun Feb 18, 2007 9:11 am

Re: Content Preview (lightbox) Function

Postby AMCAD on Wed Aug 08, 2007 6:32 pm

wildorchid wrote:
wildorchid wrote:I love the way Joomla 1.5 displays the content preview in the lightbox.

My question is if I can use this function also on the frontpage instead of normal popup window for example to show a larger image when clicking on a thumbnail included in the page content.

I noticed that there are some extensions for Joomla 1.xx but if Joomla 1.5 has this possibility natively included maybe there is a way to make use of it on the frontpage too?

Anyone has accomplished this or knows where to look?

Thanks for your help.


I finally was able to use the Joomla 1.5 native Lightbox which is called the SueezeBox on the frontpage to display images and also external HTML in an iframe Lightbox.

You need to include media/js/modal.js and media/js/modal.css into the header tags in the index.php of your template.
Code: Select all
<script type="text/javascript" src="media/system/js/modal.js"></script>

Code: Select all
link rel="stylesheet" href="media/system/css/modal.css" type="text/css" />

Next you need to include the following little Javascript to initiate the SqueezeBox:
Code: Select all
<script type="text/javascript">
    // <!--

      window.addEvent('domready', function() {

         SqueezeBox.initialize({});

         $$('a.modal').each(function(el) {
            el.addEvent('click', function(e) {
               new Event(e).stop();
               SqueezeBox.fromElement(el);
            });
         });
      });
    // -->
  </script>


Finally to call this Squeezebox for an image use:
Code: Select all
<a [color=red]rel="SqueezeBox"[/color] href="yourimagefolder/yourimage.jpg" title="Your Image Title" [color=red]class="modal"[/color]><img src="yourimagefolder/yourthumbimage.jpg" alt="Imagename" title="Your Image Title"  </a>


To call an HTML page into an iframe use:
Code: Select all
<a rel="{handler: 'iframe', size: {x: 800, y: 600}}" href="http://www.domain.com/page.html" class="modal">Testlink</a>


No guarantee that above is 100% correct but it works for me. However if only images need to be displayed in a Lightbox I prefer the script Slimbox from http://www.digitalia.be. Both Modal and Slimbox seem to be Lightbox2 clones but Slimbox is a smaller and very fast loading Lightbox script that shows the caption of the image plus has additional functionality to display image groups with next-previous buttons. Both make use of the Mootools Framework.

Cheers


Can you post a link to your site so I can see how this works? I tried it (not for the frontpage, however) and can't get it to work.

Thanks. Good job on getting it to work.
AMCAD
Joomla! Intern
Joomla! Intern
 
Posts: 79
Joined: Thu Jun 07, 2007 2:16 pm

Re: Content Preview (lightbox) Function

Postby wildorchid on Thu Aug 09, 2007 6:37 am

Can you post a link to your site so I can see how this works? I tried it (not for the frontpage, however) and can't get it to work.

Thanks. Good job on getting it to work.
[/quote]

Sorry my producation server is not online for public viewing.

However I think I know why it doesn't work for you. I forgot to metnion that of course you also have to link the mootools.js to your frontpage. Without mootools none of the lightbox scripts work. In my case I did not have to do this because my menu component already includeds the mootools into the frontpage...

Please add the following inside the tags to your template index.php:
Code: Select all
<script type="text/javascript" src="media/system/js/mootools.js"></script>
<script type="text/javascript" src="media/system/js/modal.js"></script>
<link rel="stylesheet" href="media/system/css/modal.css" type="text/css" />

<script type="text/javascript">
    // <!--

      window.addEvent('domready', function() {

         SqueezeBox.initialize({});

         $$('a.modal').each(function(el) {
            el.addEvent('click', function(e) {
               new Event(e).stop();
               SqueezeBox.fromElement(el);
            });
         });
      });
    // -->
  </script>


To call the squeezbox/lightbox use the following in Link:
Code: Select all
<a rel="SqueezeBox" href="yourimagefolder/yourimage.jpg" title="Your Image Title" class="modal"><img src="yourimagefolder/yourthumbimage.jpg" alt="Imagename" title="Your Image Title"  </a>


To open anything else than an picture e.g. a full HTML page you need to call an iframe window like this:
Code: Select all
<a rel="{handler: 'iframe', size: {x: 800, y: 600}}" href="http://www.domain.com/page.html" class="modal">Testlink</a>


I hope now you can get it to work.
Cheers
wildorchid
Joomla! Apprentice
Joomla! Apprentice
 
Posts: 14
Joined: Sun Feb 18, 2007 9:11 am

Re: Content Preview (lightbox) Function

Postby glimpse79 on Thu Aug 09, 2007 11:40 am

Have you tried to use two lightbox preview images in the same page? always open the first one...  :(

wildorchid wrote:

Can you post a link to your site so I can see how this works? I tried it (not for the frontpage, however) and can't get it to work.

Thanks. Good job on getting it to work.


Sorry my producation server is not online for public viewing.

However I think I know why it doesn't work for you. I forgot to metnion that of course you also have to link the mootools.js to your frontpage. Without mootools none of the lightbox scripts work. In my case I did not have to do this because my menu component already includeds the mootools into the frontpage...

Please add the following inside the tags to your template index.php:
Code: Select all
<script type="text/javascript" src="media/system/js/mootools.js"></script>
<script type="text/javascript" src="media/system/js/modal.js"></script>
<link rel="stylesheet" href="media/system/css/modal.css" type="text/css" />

<script type="text/javascript">
    // <!--

      window.addEvent('domready', function() {

         SqueezeBox.initialize({});

         $$('a.modal').each(function(el) {
            el.addEvent('click', function(e) {
               new Event(e).stop();
               SqueezeBox.fromElement(el);
            });
         });
      });
    // -->
  </script>


To call the squeezbox/lightbox use the following in Link:
Code: Select all
<a rel="SqueezeBox" href="yourimagefolder/yourimage.jpg" title="Your Image Title" class="modal"><img src="yourimagefolder/yourthumbimage.jpg" alt="Imagename" title="Your Image Title"  </a>


To open anything else than an picture e.g. a full HTML page you need to call an iframe window like this:
Code: Select all
<a rel="{handler: 'iframe', size: {x: 800, y: 600}}" href="http://www.domain.com/page.html" class="modal">Testlink</a>


I hope now you can get it to work.
Cheers
[/quote]
glimpse79
Joomla! Fledgling
Joomla! Fledgling
 
Posts: 4
Joined: Wed Aug 08, 2007 10:12 am

Re: Content Preview (lightbox) Function

Postby AMCAD on Thu Aug 09, 2007 1:41 pm

Now it's telling me "Squeezebox not defined in mootools.js on line 76"

What the heck? I did exactly as you told me. I must be missing something...

Help?  :-\
AMCAD
Joomla! Intern
Joomla! Intern
 
Posts: 79
Joined: Thu Jun 07, 2007 2:16 pm

Re: Content Preview (lightbox) Function

Postby wildorchid on Thu Aug 09, 2007 6:47 pm

AMCAD wrote:Now it's telling me "Squeezebox not defined in mootools.js on line 76"

What the heck? I did exactly as you told me. I must be missing something...

Help?   :-\


Did you write SqueezeBox or Squeezebox? This is case sensitive.

Best thing to do is go to the Joomla 1.5RC admin and open a new blan conten page. Right click and view source code. search the source code for the word class="modal" which will bring you to the line that has the SqueezeBox link.

By the way if you use the WYSIWYG editor be aware that even if you write the correct tag in the HTML view when saving the file the tag will be destroyed. This seems to work only with the deactivated WYSIWYG editor.

Else maybe you PM me your login to your Joomla admin and I try to take a look.
Regards
wildorchid
Joomla! Apprentice
Joomla! Apprentice
 
Posts: 14
Joined: Sun Feb 18, 2007 9:11 am

Re: Content Preview (lightbox) Function

Postby AMCAD on Fri Aug 10, 2007 1:51 pm

Got it!  :P

Here's what I had to do:

Code: Select all
<script type="text/javascript" src="../includes/js/joomla.javascript.js"></script>
  <script type="text/javascript" src="/media/system/js/mootools.js"></script>
  <script type="text/javascript" src="/media/system/js/modal.js"></script>
  <script type="text/javascript">
    // <!--
      window.addEvent('domready', function(){ var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: 'false'}); });
    // -->
  </script>
  <script type="text/javascript">
    // <!--

      window.addEvent('domready', function() {

         SqueezeBox.initialize({});

         $$('a.modal').each(function(el) {
            el.addEvent('click', function(e) {
               new Event(e).stop();
               SqueezeBox.fromElement(el);
            });
         });
      });
    // -->
</script>
<link rel="stylesheet" href="/media/system/css/modal.css" type="text/css" />

That goes in the Head of your template index.php
Make sure they are in that order. I accidentally had the stylesheet above the JS scripts and it screwed my whole site.

That's it! Super easy once you understand it. Hopefully my hours of trouble will help someone do it in 5 minutes!
AMCAD
Joomla! Intern
Joomla! Intern
 
Posts: 79
Joined: Thu Jun 07, 2007 2:16 pm

Re: Content Preview (lightbox) Function

Postby wildorchid on Fri Aug 10, 2007 6:51 pm

AMCAD,

Glad that this is working for you but please note that I have it the other way around.  The native Joomla integration in the administrator part is also the other way around which works fine.

Checking the source code on the website of the original SqueezeBox script by Harald Kirschner http://digitarald.de/playground/squeeze.html it is also the other way around.

Anyway if it works for you this is what counts.
wildorchid
Joomla! Apprentice
Joomla! Apprentice
 
Posts: 14
Joined: Sun Feb 18, 2007 9:11 am

Re: Content Preview (lightbox) Function

Postby 55thinking on Wed Aug 22, 2007 10:44 am

I had it working with the initial code of wildorchid.

Now i have a question: how to group several images as in slimbox. I can't see how to do that with SqueezeBox/Modal

Thanks for your help
Last edited by 55thinking on Wed Aug 22, 2007 11:14 am, edited 1 time in total.
55 Thinking - Strategy Design Technology 
Good looking, Fast and Usable web solutions   
http://www.55thinking.com/
User avatar
55thinking
Joomla! Enthusiast
Joomla! Enthusiast
 
Posts: 186
Joined: Mon Sep 05, 2005 8:58 am
Location: Madrid

Re: Content Preview (lightbox) Function

Postby wildorchid on Wed Aug 22, 2007 4:39 pm

55thinking wrote:I had it working with the initial code of wildorchid.

Now i have a question: how to group several images as in slimbox. I can't see how to do that with SqueezeBox/Modal

Thanks for your help


Hi 55thinking,
Don't know if this is possible. You can check the coder's website http://digitarald.de/playground/squeeze.html. He has a sample on his website but it doesn't seem to work. If you look at the source code of his website and search for the word "SmoothGallery" you will find a function and a link how to open the SqueezeBox with a gallery included. I'm not sure if you will have to add another JS script for the gallery to work.

Good luck and let us know if you got it to work.
wildorchid
Joomla! Apprentice
Joomla! Apprentice
 
Posts: 14
Joined: Sun Feb 18, 2007 9:11 am

Re: Content Preview (lightbox) Function

Postby wildorchid on Thu Aug 23, 2007 12:54 pm

Today I found a new script called Mediabox. This one is very promising. It includes the core of Slimbox 1.4 (also using Mootools 1.1.) plus adds multimedia functionality. It adds the possibility to include external websites, AJAX content, Flash animations and movie formats.

Unfortunately it is still buggy. The current version goes on playing the movie audio when closing the Slimbox if using IE7. Under MAC this bug appears in Firefox.

Mediabox by John Einselen: http://iaian7.com/webcode/Mediabox

If the developer can find a way to get rid of the bugs this script will blow away all the others.
wildorchid
Joomla! Apprentice
Joomla! Apprentice
 
Posts: 14
Joined: Sun Feb 18, 2007 9:11 am

Re: Content Preview (lightbox) Function

Postby theaer on Tue Nov 13, 2007 10:22 am

Greetings all,

No need to start a new topic so I thought I'd revive this for a little monkey wrench.

I'm attempting to use the squeezebox with the component 'contacts'. I can't figure out where to put the scripts and whatnot, however.


Any suggestions?


BTW: It works on the site, just not in the component.


Second question: Is there a way to make a menu item, when clicked, directly open up the squeezebox?
theaer
Joomla! Apprentice
Joomla! Apprentice
 
Posts: 37
Joined: Mon Nov 05, 2007 5:15 am

Re: Content Preview (lightbox) Function

Postby mininott on Mon Jan 28, 2008 12:16 pm

Hi everyone!

I am currently using this sollution to add squeezebox popups to my site, but have two problems:

1) On pages with several images with pop-ups, clikcing any of them will display the same image in all squeezeboxes, the first one being pushed
2) The squeezebox script makes the "readmore" link disappear

Any have the same problem / a sollution?

- adrian
mininott
Joomla! Apprentice
Joomla! Apprentice
 
Posts: 9
Joined: Fri Oct 06, 2006 8:40 am


Return to General Questions

Who is online

Users browsing this forum: akari, anissajid, cbridges, jaimwa, lesmentheurs, michaelocity, ooffick, zaxx and 43 guests