Hi,
I got everything installed fine. I do not use php pages on my website I use regular HTML files, except the index page. Basically it is setup as an HTML page, with one line of php code to include the news posts. How can I embed the blog into my index.php page? I do not want any headers/footers or anything else, just the blog post entries. I can do this with my current news/blogger Fusion PHP. Basically I just use a single line of code to embed the news posts into the index.php file on my server for Fusion.
I set the config to embed but it still shows the right column. Can you please assist? The index.php file in serendipity still brings up the right colum stuff even after the option is set to embed. Can I change it to be news.php instead of index.php ??
Also, on my main page I only want to include the latest headline/blog entry and they will click to a page that has them all for that month... can i link directly to a blog entry - or can i set it where it automatically grabs the latest headline and puts it there? Just ONE - not all of them. I have another page setup for all of the news/blog entries.
HTML Embed
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: HTML Embed
Hi!
Yes, serendipity can also be used as some kind of "API".
You can use that piece of code:
With that code, Serendipity prints the entries as templated in the 'entries.tpl' file.
This is the most flexible solution to use Serendipity inside your Application.
The "Embed" mode would work fine, but it's targetted at other cases, where you want a full serendipity to be embedded into your page. But you said you only wanted to see the entries.
You can adapt what is printed by looking into the serendipity files (include/functions_entries.inc.php) where the functions are documented for changing.
HTH,
Garvin
Yes, serendipity can also be used as some kind of "API".
You can use that piece of code:
Code: Select all
<?php
chdir('path/to/serendipity'); // Switch to Serendipity patch
include 'serendipity_config.inc.php'; // Include framework
serendipity_smarty_init(); // Start Smarty templating framework
serendipity_printEntries(serendipity_fetchEntries(null, true, $serendipity['fetchLimit'])); // Fetch the latest entries and parse them into Smarty template
$serendipity['smarty']->display(serendipity_getTemplateFile('entries.tpl', 'serendipityPath')); // Output the entries template
?>
This is the most flexible solution to use Serendipity inside your Application.
The "Embed" mode would work fine, but it's targetted at other cases, where you want a full serendipity to be embedded into your page. But you said you only wanted to see the entries.
You can adapt what is printed by looking into the serendipity files (include/functions_entries.inc.php) where the functions are documented for changing.
HTH,
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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
That's true, links always lead to the "full s9y installation". If you did not want that, the code from above would need to change it to something like this:
You can remove template items by copying entries.tpl to 'myentries.tpl' and specify that filename in the serendipity_getTemplate() function call.
HTH,
Garvin
That's true, links always lead to the "full s9y installation". If you did not want that, the code from above would need to change it to something like this:
Code: Select all
<?php
chdir('path/to/serendipity'); // Switch to Serendipity patch
include 'serendipity_config.inc.php'; // Include framework
$serendipity['indexFile'] = 'myindex.php'; // Target page
$serendipity['rewrite'] = 'none'; // Force no rewriting so that myindex.php is used
serendipity_smarty_init(); // Start Smarty templating framework
serendipity_printEntries(serendipity_fetchEntries(null, true, $serendipity['fetchLimit'])); // Fetch the latest entries and parse them into Smarty template
$serendipity['smarty']->display(serendipity_getTemplateFile('entries.tpl', 'serendipityPath')); // Output the entries template
?> HTH,
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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Maybe the php file has a fatal parse error, which can result in plang pages.
Have a look at your php/apache error logs, and maybe check if your display_errors directive of php.ini (see phpinfo() output) is enabled?
Regards,
Garvin
Maybe the php file has a fatal parse error, which can result in plang pages.
Have a look at your php/apache error logs, and maybe check if your display_errors directive of php.ini (see phpinfo() output) is enabled?
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/
actually the page loads and the content is showing but the styles are not loading i am attaching the link
http://www.mugsinc.com/listindex.php
http://www.mugsinc.com/listindex.php
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Sure, just have a look at the HTML output you get. There are no <html> headers. If you use the s9y embed option you need to take care of emitting HTML headers and CSS links yourself.
Best regards,
Garvin
Sure, just have a look at the HTML output you get. There are no <html> headers. If you use the s9y embed option you need to take care of emitting HTML headers and CSS links yourself.
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/
# 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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Regards,
Garvin
What do you want to achieve with the embed mode? Why do you not use the simple non-embedded serendipity mode? Embed mode is for people who know what they do with the PHP code snippet, so my guess is that it's not suited for what you want to do?mugs wrote:i am new to all of this, could you help me out with how this can be done
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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Best regards,
Garvin
Using serendipity without any extra PHP code like you posted. Without having the Serendipity Configuration option "Use embedded mode" activated.mugs wrote:what is the simple non-embedded serendipity mode
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/
# 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/