Page 1 of 1
Need help with embedding
Posted: Thu Dec 07, 2006 4:50 am
by tonypiazza
I am in the process of embedding Serendipity in static site. I have put my standard html into a PHP file and included the following snippet to generate the content of the blog:
Code: Select all
<?php
chdir('serendipity');
include 'serendipity_config.inc.php';
serendipity_smarty_init(); // Start Smarty templating framework
serendipity_printEntries(serendipity_fetchEntries(null, true, $serendipity['fetchLimit']));
$serendipity['smarty']->display(serendipity_getTemplateFile('content.tpl', 'serendipityPath'));
?>
The problem is that this doesn't generate the sidebar. So my question is - what additional code is needed to generate the sidebar on the right side of the page?
Thanks in advance for your help!
Tony
RE: Need help with embedding
Posted: Thu Dec 07, 2006 5:37 am
by tonypiazza
So I've been hacking away trying to figure out how to make this work the way I want. I'm getting real close to what I want. You can view my blog here:
http://piazzatraining.com/blog.php
Here is the code I am using:
Code: Select all
<?php
chdir('serendipity'); // Switch to Serendipity patch
include 'index.php';
serendipity_smarty_init(); // Start Smarty templating framework
?>
All that's left is to fix the following:
1) Turn off the border at the very top of the generated content. I think it's the result of a style somewhere...
2) Turn off the banner.
3) Change the formatting of dates on entries so that it uses a comma after the day of the month instead of a period.
That's it. I have to say that I am very impressed with Serendipity so far.
Let me know if you can help me resolve any of the issues listed above.
Thanks,
Tony
RE: Need help with embedding
Posted: Thu Dec 07, 2006 6:29 am
by tonypiazza
I was able to resolve the first 2 issues. The first one was a simple change to the file style.css in the appropriate template folder. The second one required me to create an index.tpl file in that folder with the banner stuff removed. The last issue (3) still has me stumped though. I would appreciate any help you can give me on that one.
Thanks,
Tony
Re: RE: Need help with embedding
Posted: Thu Dec 07, 2006 10:13 am
by garvinhicking
Hi!
The date timestamp format can be changed if you either edit your 'serendipity_lang_XX.inc.php' file in the 'lang' directory and change the "DATE_FORMAT" constant.
Alternatively you can edit the 'entries.tpl' template file of your theme and replace all occurences of "DATE_FORMAT" with your custom string like "%d.%m.%Y %H.%i".
HTH,.
Garvin