embedding configuration

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

embedding configuration

Post by AzRAeL »

hi, is it possible to set certain variables within the embedding block in a php file?

<?php
$_REQUEST['page'] = 'blog';
// Let serendipity generate our content:
ob_start();

// wanna set some variables here

require 'index.php';
$blog_data = ob_get_contents();
ob_end_clean();

// Now we include our normal content building file.
// This one has to make use of your $blog_data variable to print
// the content where appropriate!
require 'content.php';
?>

my goal is to set embedded mode in the admin interface to false, so that the blog is used in a common way, but i also want to integrate it into my site.
is it possible to set eg. embeddedmode = true, indexfile = "myintegratedfile.php" , ... within the phpfile calling the "embedded" version?

hope this is not too fuzzy to read ;-)

tia

AzRAeL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: embedding configuration

Post by garvinhicking »

Hi!

You can't do that in the embedd thing, but you can use a serendipity plugin for it, which listens on the frontend_configure hook to reset variable data.

However, why would you want to do this? If you set the variable in your script, why not directly set it through the admin interface? It wouldn't be any difference if the variables are set in the plugin/your file or in the admin interface...

Maybe you would want to make more use of the Smarty templating instead of embedding? You can use the config.inc.php file of the templates to also include custom content of yours into the smarty templates...so to say, embed your page into serendipity instead of the other way round. At least that would be easier to maintain, I figure. :)

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

i have to think it over

Post by AzRAeL »

thx for the faaaaaast answer!

I am not really sure why exactly i wanted this, but i thought having a standard serendipity blog (and only change variables for embedding, while embedding) would give me any advantage.

I first decided to embed serendipity in my page because the blog should not be main reason vor the page. I wanted to do a fully javascript powered site with lots of gimmicks, mainly for personal use of me and some friends.

maybe i'll try the plugin approach, no im more unsure about what i really want then ever before ;-)

thx anyways
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: i have to think it over

Post by garvinhicking »

Hi!

This sounds more as if you really want to use the Smarty templating. You might also use s9y as the framework for all of it; it definitely can do many tricks to you. :)

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/
Post Reply