get Plugincontents vom within an PHP file

Discussion corner for Developers of Serendipity.
Post Reply
AzRAeL
Regular
Posts: 22
Joined: Sun May 28, 2006 7:45 pm

get Plugincontents vom within an PHP file

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: get Plugincontents vom within an PHP file

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
AzRAeL
Regular
Posts: 22
Joined: Sun May 28, 2006 7:45 pm

great!!

Post by AzRAeL »

thanx a lot - this is exactly what i needed ;-)
Post Reply