Quantcast
toolbar_logo graphic
Group discussion > Comment content using Ajax

Comment content using Ajax

Ray J
108 days ago

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.

Ismayil Khayredinov
108 days ago

In 1.8, rel="fancybox" should do it

Ray J
108 days ago

@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?

Matt Beckett
108 days ago

@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.

Ray J
108 days ago

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