Page 1 of 1

embedding configuration

Posted: Tue Jun 20, 2006 10:11 am
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

Re: embedding configuration

Posted: Tue Jun 20, 2006 11:57 am
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

i have to think it over

Posted: Tue Jun 20, 2006 1:13 pm
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

Re: i have to think it over

Posted: Tue Jun 20, 2006 1:40 pm
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