Page 1 of 1

Embedding

Posted: Sun Mar 26, 2006 9:46 pm
by An0nym0us
Hello there!

I see, my subject was here before, but no thread was helping me out.

I made an own layout using YAML and want to embed Serendipity there. BTW: Serendipity is really cool. In my option even a little better than Wordpress which seems nice (tested it once).

First ist tried to include the index.php via php "include"- or "require"-function like this:
<?php
chdir("<serendipity_dir>");
require("index.php");
chdir("<original_dir>");
?>
I got the page but only the left an right sidebar.

After that I got managed to list left and right sidebar seperated using the plugin-class-function. Also works great.

The Problem: The blog posts/articles are never displayed. I can only see them if I look up the original index.php...

Any suggestions? Maybe I just can't look at my code anymore :shock:

Greetings
An0nym0us

Re: Embedding

Posted: Sun Mar 26, 2006 9:49 pm
by garvinhicking
Hi!

I wonder if you really need the embed mode! Can't you just edit the index.tpl template of your Serendipty template (and maybe entries.tpl as well) to use the YAML template for Serendipity?

Please go to www.s9y.org and look inside the technical documentation for an embed example PHP code which properly works. You must use ob_start() and ob_get_contents() the least.

Embed mode is really only used if you use large PHP frameworks to power your site and want to use a unified template. In all other cases just modifying the smarty templates is the much better way to go.

Embed mode was invented before Serendipity had Smarty templating. :)

Best regards,
Garvin

Posted: Sun Mar 26, 2006 10:06 pm
by An0nym0us
This is all too easy :P

Thank you, I'm not considering but building a template :)

Thanks!

Posted: Sun Mar 26, 2006 10:08 pm
by garvinhicking
Hi!

Great to hear that! Have fun! :)

Regards,
Garvin