Comment content using Ajax

Dear friends,

I have a plugin that shows tidypics images in a lightbox (Colorbox). I want to develop a plugin to show the comments for each image inside the colorbox. It´s easy. But I want to show a form allowing commenting inside the colorbox. (Facebook style)

Are there some ajax framework for elgg? Some code snippet for ajax commenting? Colorbox loads all images and should load all comments in isolated divs, showing one at once. How ELGG faces two or more forms in the same page?

Thanks for now.

  • In 1.8, rel="fancybox" should do it

  • @Ismayi: Fancybox is a jquery plugin, right? Is that easy use it in ELGG? Is a "out of box" solution? Just create the divs, load the forms and content?

  • @Ray J - yes it's included in elgg core.  I don't know about rel="fancybox", but I know class="elgg-lightbox" is the "elgg-ish" way to do it.

    From my extendafriend plugin:

    elgg_view("output/url", array("href" => $approveurl,
                                                        "text" => elgg_echo("friend_request:approve"),
                                                        "is_action" => true,
                                                        "class" => 'elgg-lightbox'));

     

    This creates a link that opens up a form in a lightbox (the same kind of lightbox that "embed" uses)

    All you have to do is create the page/content, then link to it with the class 'elgg-lightbox' and you're good to go.

  • I will try. Will be a good feature for tidypics. Thanks for now.