Page 1 of 2

Would anyone be willing to show me how to embed my blog?

Posted: Mon Dec 12, 2005 6:33 am
by sandie
Hi

I am new to CSS and PHP and I'm trying to install my blog so that it is embedded into a page. My site is currently built with messy html and very simple use of php with no CSS to be seen. Each page of the site calls a header.html and footer.html which contain my menu, banner and such like. For example page1.php would contain <?php include("visitorheader.html"); ?> at the top and <?php include("visitorfooter.html"); ?> at the bottom. So, now I'm adding a new page for the blog but I want it to contain the same header and footer. I have messed about but I cant get it to work properly and thus I'm asking for help here as it will take me weeks of learning before I'm competent enough to do it on my own.

Many thanks

Sandie

Re: Would anyone be willing to show me how to embed my blog?

Posted: Mon Dec 12, 2005 9:52 am
by garvinhicking
Actually the easiest method is to edit the file "index.tpl" of your selected template. If your template doesn't have that file, copy it over from the default/ directory.

Then you can place these calls at the places you want to include:

Code: Select all

{include_php file="/path/to/visitorheader.html"}
By default, Serendipity's template Engine (Smarty, http://smarty.php.net) has security mode activated which does not allow inclusion of PHP calls. You need to disable this in your case, because you want to include PHP code.

For that, create a file "config.inc.php" inside your config dir. Put this code in it:

Code: Select all

<?php
$serendipity['smarty']->security = false;
?>
That is much easier than using the deprecated serendipity embed directive. :-)

Best regards,
Garvin

Posted: Mon Dec 12, 2005 7:08 pm
by Guest
Hi Garvin

Where is the config directory? I can't find it in the serendipity directory, am I looking in the wrong place?

Best regards

Sandie

Posted: Tue Dec 13, 2005 10:39 am
by garvinhicking
You must put that config.inc.php file in the directory of your template. I'm sorry that I just wrote "in the config dir", I wasn't clear on that. :)

Best regards,
Garvin

Posted: Wed Dec 14, 2005 9:44 am
by Guest
Hi Garvin

It's working now thanks to your help. the only thing is I can get the mainpane to align in the center of the page but not the serendipity banner which is stuck over on the left of the page. Is this contoled from the index.tpl or the style sheet?

Regards
Sandie

Posted: Wed Dec 14, 2005 3:54 pm
by garvinhicking
Actually this is more a thing of your CSS stylesheet than in HTML; but you could fix it in both places :)

Best regards,
Garvin

Posted: Thu Dec 15, 2005 9:55 am
by Guest
Garvin

I can't figure it out, no matter what I try the serendipty banner is on the left of the screen and not in the center. Here is the portion of the css I am messing with

#serendipity_banner {
font-family: Arial, 'Times New Roman', serif;
color: #FFFFFF;
background-color: #B503B5;
text-align: left;
border-bottom: 0px solid #FFFFFF;
border-left: 4px solid #FFFFFF;
border-right: 4px solid #FFFFFF;
width: 649px;
height: 76px;
margin: auto;

Can you shed some light?
Much appreciated
Sandie

Posted: Thu Dec 15, 2005 11:45 am
by Guest
If you give me your URL, I can shed some light.

But you did not use propper aligning code. Instead of "margin: auto" you need to use "margin: 0px auto 0px auto" for center alignment. Also use "text-align: center".

Regards,
Garvin

Posted: Thu Dec 15, 2005 6:51 pm
by sandie
Hi Garvin

Tried what you suggested but no luck in IE. It's fine in Firefox though. I PM'd you with the URL

Regards

Sandie

SSI

Posted: Tue Dec 20, 2005 5:28 pm
by muligruber
Will this work with SSI inserting the following into the index.tpl?

<!--#include virtual="" -->

Re: SSI

Posted: Tue Dec 20, 2005 5:58 pm
by garvinhicking
muligruber: You might need to try it. I don't know when Apache parses SSI.

You should use smarty or PHP includes instead, though. They're faster and integrate more smoothly.

Regards,
Garvin

Posted: Tue Dec 20, 2005 7:41 pm
by Guest
I thought it was all looking cool but now I discover that I can only view entries when Im logged in to the admin and no one else can see them, any ideas?

sandie

www.hornytimes.com/blog

please dont look if adult topics offend you

Posted: Tue Dec 20, 2005 7:59 pm
by garvinhicking
Sandy: Did you look at the category permissions? You need to set the "read" permission to Everyone for all people to be able to read entries.

Regards,
Garvin

Posted: Tue Dec 20, 2005 8:10 pm
by Guest
That's it, I'm off to send you something from your wish list now, you've helped me far to much to be taken for granted recently

Thanks again

Sandie

Posted: Tue Dec 20, 2005 9:16 pm
by garvinhicking
:-)

I'm glad I could help you! Hope you'll have fun blogging with Serendipity and your "adventures" ;-)

Best regards,
Garvin