Would like to use pop window feature as used for the help guides

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/10/2011 4:34:09 AM
Gravatar
Total Posts 9

Would like to use pop window feature as used for the help guides

Hi,

I would like to implement some kind of lightbox style help pop up window a kin to the one mojoPortal already uses in it's CMS interface.  Is this a function I can call easily or will I have to integrate lightbox into the layout.master myself?

 

Thanks

8/10/2011 6:22:59 AM
Gravatar
Total Posts 51

Re: Would like to use pop window feature as used for the help guides

Hi,

I can tell you how I use it. In layout.master find <asp:ScriptManager.. After that add the code below. That's all what you need. At the end you see examples for using colorbox.

Hope that helps,
Erhan

<script>
     $(document).ready(function () {
          $("a[rel='cbFoto']").colorbox();
          $(".cbVideoEmbedded").colorbox();
          $(".cbVideoIframe").colorbox({ iframe: true, innerWidth: 425, innerHeight: 344 });
          $(".cbWebpage").colorbox({ width: "80%", height: "80%", iframe: true });
     });
</script>

<p><a href="../images/opee1.jpg" rel="cbFoto" title="Foto1">Photo 1</a></p>
<p><a class=”cbVideoEmbedded” href="../content/flash.html" title="Video1">Flash / Video (Ajax/Embedded)</a></p>

<p><a class=”cbVideoIframe” href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent" title="Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p>

<p><a class=”cbWebpage” href="http://google.com">Outside Webpage (Iframe)</a></p>

8/10/2011 6:38:21 AM
Gravatar
Total Posts 18439

Re: Would like to use pop window feature as used for the help guides

A very simple way is just set <portal:ScriptLoader IncludeColorbox="true"... in layout.master.

Then you can decorate any link with class="cblink" and it will automatically open in a colorbox without any additional coding on your part.

However if you don't like the standard colorbox settings and want more control then you would need to do something like what Erhan suggested so you can control all of the colorbox settings.

Hope that helps,

Joe

9/6/2011 5:24:23 PM
Gravatar
Total Posts 51

Re: Would like to use pop window feature as used for the help guides

Thanks Joe and Erhan.

I follow Joe´s advise and "class=cblink". It works fine with images. But how can I use colorbox to display a webpage or play a video from youtube. Should I still use "class=cblink" for all?

Thanks

9/7/2011 3:50:35 PM
Gravatar
Total Posts 51

Re: Would like to use pop window feature as used for the help guides

Hi Craig_Mac,

I don't think that you can play a video or display a webpage with "class=cblink". It's very easy and flexible to do these things if you follow my first suggestion; 

In layout.master find <asp:ScriptManager.. After that add the code below.  

<script>
      $(document).ready(function () {
           $(".cbVideoIframe").colorbox({ iframe: true, innerWidth: 425, innerHeight: 344 });
           $(".cbWebpage").colorbox({ width: "80%", height: "80%", iframe: true });
      });
</script>

 

Here are some examples for using colorbox in HTML Content for 1. playing a youtube video, 2. displaying a webpage;

<p><a class=”cbVideoIframe” href="http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent" title="Our Mother's Health">Flash / Video (Iframe/Direct Link To YouTube)</a></p>

<p><a class=”cbWebpage” href="http://google.com">Outside Webpage (Iframe)</a></p>

 

You can try it and let me know if you have any problem,

Hope that helps,
Erhan

9/7/2011 6:45:07 PM
Gravatar
Total Posts 51

Re: Would like to use pop window feature as used for the help guides

Please correct me if I´m wrong -;)

I followed Erhan suggestion, but place the script of ColorBox together with "toolbarmenu" script like this:

<script type="text/javascript">
        function HideMenuToolbar() { $("#toolbar").fadeOut(); $("#toolbarbut").fadeIn("slow"); }
        function ShowMenuToolbar() { $("#toolbar").fadeIn(); $("#toolbarbut").fadeOut("slow"); }
        $(document).ready(function() {
            $("span.downarr a").click(function() { HideMenuToolbar(); Set_Cookie('openstate', 'closed') });
            $("span.showbar a").click(function() { ShowMenuToolbar(); Set_Cookie('openstate', 'open') });
            $("span.downarr a, span.showbar a").click(function() { return false; });
            var openState = Get_Cookie('openstate');
            if (openState != null) { if (openState == 'closed') { HideMenuToolbar(); } if (openState == 'open') { ShowMenuToolbar(); } }

            $("a[rel='cbimage']").colorbox();
            $("a[rel='cbslideshow']").colorbox({ slideshow: true });
            $(".cbvideoEmbedded").colorbox();
            $(".cbvideo").colorbox({ iframe: true, innerWidth: 640, innerHeight: 385 });
            $(".cbweblink").colorbox({ width: "80%", height: "80%", iframe: true });
            $(".cbinline").colorbox({ width: "50%", inline: true, href: "#inline_doc" });
        });
    </script>

I don´t get any error, but I never see the ColorBox in action. I only see the popup window with the loading gif. It was also the same when I placed the ColorBox script below <asp:ScriptManager.. as suggested by Erhan.

What am I doing wrong??

Thanks

9/8/2011 2:19:14 AM
Gravatar
Total Posts 51

Re: Would like to use pop window feature as used for the help guides

It works by me as described from you. It's very strange because you write that you see popup window.

I assume you add for example for displaying an image rel="cbimage" in HTML content;

<p><a href="../images/xxx.jpg" rel="cbimage" title="Foto1">Photo 1</a></p>

 

You can try this. If you have mojoPortal version 2.3.6.7, find <portal:ScriptLoader.. in head section and add IncludeColorBox="true" as followed;

<portal:ScriptLoader ID="ScriptLoader1" runat="server" IncludeColorBox="true" />

 

Hope that helps,
Erhan
 

You must sign in to post in the forums. This thread is closed to new posts.