Page 1 of 1
get Plugincontents vom within an PHP file
Posted: Sun May 28, 2006 7:53 pm
by AzRAeL
Hi, i am currently developing an ajax-driven website (
http://www.warpzone.at) using serendipity in embedded mode. I removed the sidebar from the index.tpl. Now i want to Popup eg the Archive or Blogroll sidebar plugin. I tried to create a new php file besides the index.php of serendipity, but somehow i just cannot output just the sidebar contents ;-(
Is there any possibility?
tia
Azzy
Re: get Plugincontents vom within an PHP file
Posted: Sun May 28, 2006 9:49 pm
by garvinhicking
Hi!
You can use a PHP file like this to get just the sidebar output:
Code: Select all
<?php
// Include the s9y framework:
include 'serendipity_config.inc.php';
// Initialize the SMARTY templating framework
serendipity_smarty_init();
// Parse and display a custom SMARTY template file:
$serendipity['smarty']->display(serendipity_getTemplateFile('only_sidebars.tpl', 'serendipityPath'));
?>
Then you need to create a smarty template file with a content like this:
Code: Select all
<div>
{serendipity_printSidebar side="left"}
</div>
(this would be saved in the templates/yourtemplate/only_sidebars.tpl structure)
If you want (because of performance issues) to not utilize the Smarty framework for wrapping the sidebaars you could use a PHP code like this:
Code: Select all
<?php
// Include the s9y framework:
include 'serendipity_config.inc.php';
echo serendipity_plugin_api::generate_plugins('left');
?>
I'm very interested in the results of your page, please let us know about your progress! Also if you need any more help!
Best regards,
Garvin
great!!
Posted: Sun May 28, 2006 9:53 pm
by AzRAeL
thanx a lot - this is exactly what i needed
