Forums / Setup & design / Loading Template via Ajax

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Loading Template via Ajax

Author Message

Mohammad Tufail

Thursday 12 June 2008 11:33:12 pm

Hi,

I want to implement Ajax in my website but does not know how. Actually I am designing a part of my website same as http://www.profoss.eu/events

Anyone have idea?

Regards,

 

Laurent BOURREL

Thursday 12 June 2008 11:44:40 pm

Hi,

The most simple (but not the only way) is the xajax extension : http://ez.no/developer/contribs/applications/xajax

The API can be found : http://www.xajaxproject.org/

Here an exemple of xajax module with a template fetch :

function xxxx($object_id) {

	// HTTP Response
	$objResponse = new xajaxResponse();
	
	// template init
	$tpl =& templateInit();
	
	// Add Variable to the template
	$tpl->setVariable('object_id', $object_id);

	// fetch template
	$html = $tpl->fetch( "extension/mod_myextension/design/standard/templates/foo/bar.tpl" );

	$objResponse->addAssign("mydiv", "innerHTML", $html);
	
	// response
	return $objResponse;
}

HTH...