embed at root level
-
deepspace
- Regular
- Posts: 17
- Joined: Sat Nov 07, 2009 7:12 pm
- Location: Upper NW Corner of Continetal US
embed at root level
Hi, I need to embed at the root level of a web site. After looking at all the documentation, seems they call from a directory above. Question is this wrapper.php, how can it call index.php when I need index.php to be the home page?
Thanks in advance!
Thanks in advance!
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: embed at root level
What?
Can you be more specific, maybe with actual URLs and what the goal and setup is? 
Regards,
Garvin
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/
# 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/
-
deepspace
- Regular
- Posts: 17
- Joined: Sat Nov 07, 2009 7:12 pm
- Location: Upper NW Corner of Continetal US
Re: embed at root level
Sorry to have not been clear. When viewing the embedding page tutorial it has:
<?php
chdir("<serendipity_dir>");
require("index.php");
chdir("<original_dir>");
?>
which is used to create a "wrappper.php"
My query is I only want the blog in the middle of the index page, where it says BLOG GOES HERE.
The page I am working with is http://www.leeofsted.com/index.php
<?php
chdir("<serendipity_dir>");
require("index.php");
chdir("<original_dir>");
?>
which is used to create a "wrappper.php"
My query is I only want the blog in the middle of the index page, where it says BLOG GOES HERE.
The page I am working with is http://www.leeofsted.com/index.php
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: embed at root level
Hi!
The wrapper.php uses ob_start() to capture the "blog goes here" content. Then inside your index.php you only need to place that variable at the place where you want the blog outputs.
Bear in mind that embedding is an advanced mechanism where you should know some PHP to understand the concept. If that is too hard, we recommend not to use Embedding, but instead create a custom smarty template and place all your custom header/footer things into the index.tpl template file to create a consistent layout...
Regards,
Garvin
The wrapper.php uses ob_start() to capture the "blog goes here" content. Then inside your index.php you only need to place that variable at the place where you want the blog outputs.
Bear in mind that embedding is an advanced mechanism where you should know some PHP to understand the concept. If that is too hard, we recommend not to use Embedding, but instead create a custom smarty template and place all your custom header/footer things into the index.tpl template file to create a consistent layout...
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/
# 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/
-
deepspace
- Regular
- Posts: 17
- Joined: Sat Nov 07, 2009 7:12 pm
- Location: Upper NW Corner of Continetal US
Re: embed at root level
Thank you for the replies. I think I could handle the php but have been following other queries and found this onehttp://board.s9y.org/viewtopic.php?f=1& ... lls#p91002 which is clean. Seems like the best option all I need to do would be to alter the paths. Create the template folder, create: templates/ofsted/index.tbl, info.txt and styles.css then on index.php refer to these files. Am I seeing this correctly?
Thanks-Marc
Thanks-Marc
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: embed at root level
Hi!
Yeah, exactly!
Just have a try, if you've got specific problems, come bakc here, we'll try to help!
Regards,
Garvin
Yeah, exactly!
Just have a try, if you've got specific problems, come bakc here, we'll try to help!
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/
# 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/
-
deepspace
- Regular
- Posts: 17
- Joined: Sat Nov 07, 2009 7:12 pm
- Location: Upper NW Corner of Continetal US
Re: embed at root level
Sorry I have just one more question before I go forward. Here is current head for index.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>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="#" />
<meta name="keywords" content="#" />
<meta name="author" content="#" />
<link rel="stylesheet" type="text/css" href="css/lee_main.css" media="screen" />
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
<title>Home of fictional pro golfer Lee Ofsted</title>
</head>
I add this:
<meta name="Powered-By" content="Serendipity v.{$head_version}" />
<link rel="stylesheet" type="text/css" href="
{template/ofsted/$head_link_stylesheet} DO I NEED TO LINK TO INDEX.TBL HERE ALSO
" />
<link rel="alternate" type="application/rss+xml" title="{$blogTitle} RSS feed" href="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/index.rss2" />
<link rel="alternate" type="application/x.atom+xml" title="{$blogTitle} Atom feed" href="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/atom.xml" />
{if $entry_id}
<link rel="pingback" href="{$serendipityBaseURL}comment.php?type=pingback&entry_id={$entry_id}" />
{/if}
{serendipity_hookPlugin hook="frontend_header"}
Cheers-Marc
<!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>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="#" />
<meta name="keywords" content="#" />
<meta name="author" content="#" />
<link rel="stylesheet" type="text/css" href="css/lee_main.css" media="screen" />
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
<title>Home of fictional pro golfer Lee Ofsted</title>
</head>
I add this:
<meta name="Powered-By" content="Serendipity v.{$head_version}" />
<link rel="stylesheet" type="text/css" href="
<link rel="alternate" type="application/rss+xml" title="{$blogTitle} RSS feed" href="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/index.rss2" />
<link rel="alternate" type="application/x.atom+xml" title="{$blogTitle} Atom feed" href="{$serendipityBaseURL}{$serendipityRewritePrefix}feeds/atom.xml" />
{if $entry_id}
<link rel="pingback" href="{$serendipityBaseURL}comment.php?type=pingback&entry_id={$entry_id}" />
{/if}
{serendipity_hookPlugin hook="frontend_header"}
Cheers-Marc
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: embed at root level
Hi!
You copy the code from index.php to index.tpl, not the other way round, right?
That means, you only need to add what you have in your index.php to index.tpl - you leave the CSS etc. code in index.tpl intact that is already there.
Regards,
Garvin
You copy the code from index.php to index.tpl, not the other way round, right?
That means, you only need to add what you have in your index.php to index.tpl - you leave the CSS etc. code in index.tpl intact that is already there.
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/
# 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/
-
deepspace
- Regular
- Posts: 17
- Joined: Sat Nov 07, 2009 7:12 pm
- Location: Upper NW Corner of Continetal US
Re: embed at root level
Good Morning, I guess I am not being clear. Some how index.php needs to call index.tbl. Plus index php needs a php action.
I did as you said, created index.tbl out of index.php.
Thanks-Marc
I did as you said, created index.tbl out of index.php.
Thanks-Marc
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: embed at root level
Hi!
You actually would now no longer link to index.php when you want to display your blog, but to /serendipity/index.php (or /blog/index.php, or whatever you chose). This would then contain your layout. If you want to make serendipity appear in the root of your domain, you could simply install Serendipity into the root, so that it's index.php would be your starting point?
You could also automatically redirect people to /blog/index.php through your /index.php if you enter a code like
Does that help? I'm not exactly sure I understand what you try to achieve 
Regards,
Garvin
You actually would now no longer link to index.php when you want to display your blog, but to /serendipity/index.php (or /blog/index.php, or whatever you chose). This would then contain your layout. If you want to make serendipity appear in the root of your domain, you could simply install Serendipity into the root, so that it's index.php would be your starting point?
You could also automatically redirect people to /blog/index.php through your /index.php if you enter a code like
Code: Select all
<?php
header('Location: /blog/index.php');
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/
# 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/
-
deepspace
- Regular
- Posts: 17
- Joined: Sat Nov 07, 2009 7:12 pm
- Location: Upper NW Corner of Continetal US
Re: embed at root level
Thank you, this blog is at the root level, and needs to be on the index.php page. Where is on another level it would be no problems. I just need to call the blog into the lower portion of a static page.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: embed at root level
Hi!
The idea of the posting you linked is to create a blog layout (instead of embedding) that goes into your index.tpl, that mimics your static layout. This is why you need to put your index.php layout into the index.tpl template file of serendipity. For that, you can include the CSS stylesheet that you also include in the index.php. Maybe go through again that link again, it's actually explained in depth there...?
Regards,
Garvin
The idea of the posting you linked is to create a blog layout (instead of embedding) that goes into your index.tpl, that mimics your static layout. This is why you need to put your index.php layout into the index.tpl template file of serendipity. For that, you can include the CSS stylesheet that you also include in the index.php. Maybe go through again that link again, it's actually explained in depth there...?
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/
# 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/
-
deepspace
- Regular
- Posts: 17
- Joined: Sat Nov 07, 2009 7:12 pm
- Location: Upper NW Corner of Continetal US
Re: embed at root level
I got it, almost. I just needed to subtract an extra /if, now just to work with the css.
Its located athttp://www.leeofsted.com/ Thanks for all your help.
Its located athttp://www.leeofsted.com/ Thanks for all your help.
-
deepspace
- Regular
- Posts: 17
- Joined: Sat Nov 07, 2009 7:12 pm
- Location: Upper NW Corner of Continetal US
Re: embed at root level
Thanks again for the help. Looks as though I made a mountain out of a mole hill. I am wondering how it is I could run another php script now. Say I wanted to place a very simple php survey It seems as though since index.tbl is not a php file in itself <?php.... ?> would not work.
Cheers-Marc
Cheers-Marc
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: embed at root level
Hi!
Inside smarty, you can either use {include_php} or {php}...{/php} tags. You might need to create a config.inc.php file inside your template directory though with this:
to allow using PHP tags.
REgards,
Garvin
deepspace wrote:Thanks again for the help. Looks as though I made a mountain out of a mole hill. I am wondering how it is I could run another php script now. Say I wanted to place a very simple php survey It seems as though since index.tbl is not a php file in itself <?php.... ?> would not work.
Cheers-Marc
Inside smarty, you can either use {include_php} or {php}...{/php} tags. You might need to create a config.inc.php file inside your template directory though with this:
Code: Select all
<?php
$serendipity['smarty']->security = false;
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/
# 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/