ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

jQuery dialog window examples?

July 23, 2012 11:06pm

Subscribe [1]
  • #1 / Jul 23, 2012 11:06pm

    Stake

    22 posts

    I’m trying to create a dialog windows with jQuery (very new to it) but I’m not sure what the code should look like in EE. Are there any good examples of how this functions in EE and some example code?

    Specifically, I’m looking to have a dialog window appear when clicking on a link. However that dialog window would contain content from a channel entry.

  • #2 / Aug 02, 2012 8:05pm

    Aaren Hofferth

    55 posts

    There isn’t anything out of the ordinary that you need to do to create a dialog window in EE. The only EE related code you’d need is outputting the content with a simple exp:channel tag.

    That being said—my go to dialog window script is Fancybox (http://fancyapps.com/fancybox/) which is very well made and sports many desirable features associated with dialog windows.

    With this solution, you could accomplish what you want like this:

    (Inside script tags)

    $(document).ready(function() {
      $(".fancybox").fancybox();
    });

    And then this

    <a href="#contentclass=fancybox">Link to content</a>
    
    <div id="content">
    {exp:channel:entries channel="blog" entry_id="1234" dynamic="off"}
    {body}
    {/exp:channel:entries}
    </div>
  • #3 / Aug 02, 2012 8:17pm

    Stake

    22 posts

    I’ll give this a try. Thanks!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases