Page 1 of 1

yet another embedding question

Posted: Sun Apr 09, 2006 10:04 pm
by neil
Hi, I'm trying to embed s9y into an existing site that has existing templates / css, etc.

I've been reading and reading the main docs and forum posts on this subject, but don't still quite seem to get it.

I was trying the 'wrapper.php' approach, where I have a page called, say, 'blog.php' in the root directory in the main site, which would be the page where I want all content to show.

The page 'blog.php' contains the following code to build the page:

<? require("serendipity/wrapper.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD><TITLE>MY BLOG</TITLE>
<? include("scripts/toptemplate.php");?>
<? echo $blog;?>
<? include("scripts/footer.php");?>

The page 'wrapper.php' in the serendipity directory contains the following code:

<?
ob_start();
$a = getcwd();
chdir($a."/serendipity");
require("index.php");
chdir($a);
$blog = ob_get_contents();
ob_end_clean();
?>


Now, this is OK and it will show the serendipity blog embedded within the page.

However, if I click on any of links, this takes me to a new page within the serendipity directory - effectively out of the main site.

I can't quite figure out what I need to tweak at this point to get this working.

I don't want to embed into an iframe, as this means that search engines will have difficulty spidering the content.

Is it actually possible to effectively run everything from one URL using GET query string ?

Thanks
Neil.

Re: yet another embedding question

Posted: Mon Apr 10, 2006 9:35 am
by garvinhicking
Hi!

Actually, this is what the "indexFile" s9y Configuration directive is for. By default it'S set to "index.php" but you need to change it to "wrapper.php"!

Regards,
Garvin

Posted: Mon Apr 10, 2006 11:59 am
by neil
Hi,

That's what I thought I had to do.

I had set the indexFile to 'wrapper.php', and this has no problem displaying the initial blog entries.

However, if I click on any entries within the page, they take me to a page with the serendipity directory:

i.e.

http://127.0.0.1/testsite/serendipity/a ... -post.html

Same thing happens if I click on 'archives', reply, etc.

I guess I am nearly there, but how do I bind all these links to the page blog.php

what I guess I need is:

http://127.0.0.1/testsite/blog.php?page ... -post.html


Don't quite figure out where I'm messing up here...

Thanks
Neil.

Posted: Mon Apr 10, 2006 12:19 pm
by garvinhicking
Hi!

These "pretty URLs" are bound via your .htaccess file. usually if you change the "indexfile" option, serendipty recreates the .htaccess file to insert "wrapper.php" instead of "index.php" there. You can also do that manually, and then the URLS should correctly forward to the right file.

Best regards,
Garvin

Posted: Tue Apr 11, 2006 2:10 pm
by neil
Hi,

I managed to crack this problem and get it working. Compared to the trauma of trying to embed WordPress in an existing site, this has been much easier in comparison.

The only issue I seem to be having at the moment is matching the css styles of the posts so they mirror the rest of my site.

I moved (and altered) a number of css directives from the template css files to my main css file, and this works OK.

However, I can't locate the css directives for some of the sidebar functions (such as Archives, etc).

Are these located within other directories ?

Thanks
Neil.

Posted: Tue Apr 11, 2006 2:32 pm
by garvinhicking
Hi Neil!

Great to hear you'Re making progress! :)

All of the CSS code should be found within the style.css file, actually. What exactly are you looking for?

Regards,
Garvin

Posted: Tue Apr 11, 2006 2:43 pm
by neil
Sorry, you are correct.

I managed to find everything within the styles.css

I think I have spent so long doing this today that I can't think straight any more. Time to go out for a coffee....

Many Thanks
Neil.