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

Having trouble installing serendipity?
sandie
Regular
Posts: 6
Joined: Sun Dec 11, 2005 6:22 pm
Location: UK

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

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

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

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post 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
Guest

Post 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
sandie
Regular
Posts: 6
Joined: Sun Dec 11, 2005 6:22 pm
Location: UK

Post 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
muligruber

SSI

Post by muligruber »

Will this work with SSI inserting the following into the index.tpl?

<!--#include virtual="" -->
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: SSI

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Guest

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

:-)

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

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply