[pmwiki-users] PmWiki in AJAX

Etienne Convié etienne at convie.net
Wed Feb 11 13:10:13 CST 2009


Hi,

Great! This is exactly what I searched! Sorry for my late answer... a 
few days without coding ;-)
Thank you very much.

If I can ask something else, I would like ton know how to retrieve the 
result of the *.tmpl file in the same function that you gave me (below) 
in place of  MarkupToHTML($pagename, $page['text']) for example.

Could you help me with this?
Thanks a lot,
etco
>   $HandleActions['json'] = 'HandleJSONcontent'; # for ?action=json
>
>   function HandleJSONcontent($pagename, $auth='read')
>   {
> 	$page = RetrieveAuthPage($pagename,$auth,1, READPAGE_CURRENT);
> 	$toAJAX = array(
> 		'title' => array(
> 		'innerHTML' => PageVar($pagename,'$Titlespaced')
> 		),
> 		'content' => array(
> 		'innerHTML' => MarkupToHTML($pagename, $page['text'])
> 		)
> 	);
> 	echo json_encode($toAJAX);
> 	exit();
>   }
>   



More information about the pmwiki-users mailing list