Microsoft FrontPage and Serendipity

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Microsoft FrontPage and Serendipity

Post by Don Chambers »

Big time noob here. Let me start by saying I am really impressed by Serendipity!! Hats off to the development team!!

I have little web experience. In fact, the site I am working on is only the 3rd time I have ever attempted such a thing, the the previous 2 were the earlier generations of the same site!!! The site is a tiny site used exclusively to help promote a little boating event I host every spring in the Chicago (USA) metro area. For the first time, this event now has its own domain, and I taught myself how to make it fairly graphical.

I am using MS FrontPage, merely because it happened to be bundled into my particular MS Office suite (2002). I'm sure it has all kinds of code bloat and inefficiencies to it, but like I said, this is a learning experience, so please forgive my "skid marks". Ideally, I would love to learn enough about HTML, PHP, CSS, etc to allow me to change the code from what I have, to something super efficient. I figure I have from now until next year's event to do that!

The site uses FrontPage themes. I am not sure to what degree the FP themes are affecting my sheets - certainly the fonts (although, I blew many of those), header, and footer. I believe the theme uses CSS to some degree, but I am not overly familiar with it.

A limitation to MS FrontPage seems to be that I can not FTP anything, as it seems to mess up the server permissions. I have shared hosting at godaddy, which is how I came to discover Serenity in the first place.

Having spent some time putting together an esthetically pleasing site (emulating pieces of sites I have seen elsewhere - but I did draw everything myself), I would like to place the output of Serendipity on one of my pages, or perhaps something else. Here is a default page where the output MIGHT go, together with a few choices at to what I am thinking: http://www.chicagoloopcruise.com/news.htm. This page is not linked into the navigational structure of the rest of the site, but the links on that page are active to the balance of the site.

I have read various posts on embedding, but have not really locked onto what I belive fits my particular set of restrictions. I get the feeling that I might need to create a theme or something that matches my layout, but since I am not using css (directly anyway), but I am using MS FrontPage Themes, I am not sure where to begin. I also get the feeling that the index.php file may be something I need to play with as well..

So, anyone want to walk me through a MS FrontPage implementation of Serendipity??? Please??? :) Might help some others too!!!

PS - unlike some others, I had no problem getting the basics up and running with Serendipity on godaddy. I'm still playing around with entries, comments, etc, and you probably know where to see that since I gave you my URL above.
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

I'm not familiar with FrontPage, beyond the trouble it causes in other web development forums. But it looks to me like your best bet will be to embed Serendipity into your page.

For this to work correctly, your page will have to be able to stretch to fit the Serendipity content, and you'll need a Serendipity theme that fits your FrontPage theme.

I assume you only want the news, not the sidebars or header.

Set your theme to the default. Copy the index.tpl to another file, like index.tpl.orig. Then make this your new index.tpl:

Code: Select all

{if $is_embedded != true}
{if $is_xhtml}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{else}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
           "http://www.w3.org/TR/html4/loose.dtd">
{/if}

<html>
<head>
    <title>{$head_title|@default:$blogTitle} {if $head_subtitle} - {$head_subtitle}{/if}</title>
    <meta http-equiv="Content-Type" content="text/html; charset={$head_charset}" />
    <meta name="Powered-By" content="Serendipity v.{$head_version}" />
    <link rel="stylesheet" type="text/css" href="{$head_link_stylesheet}" />
    <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}
</head>
<body>
{/if}
  <div id="content">{$CONTENT}</div>
{if $is_embedded != true}
</body>
</html>
{/if}
This template assumes you will never want sidebars, and that you will provide your own banner and container for the Serendipity content.

Now set your Serendipity configuration so it's embedded, and check out the Embedding FAQ.

There's one final step: your file (where you currently have your requirements) has to be parsed as PHP. That means it either needs the .php extension, or you need to set up your .htaccess to parse whatever kind of file it is.

If you have any trouble, let us know. Especially with that template; I haven't tested it yet.
Judebert
---
Website | Wishlist | PayPal
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Thanks for the reply judebert.

Before I can begin moving in the direction you suggest, I need to get the index.tpl file. However, when I look at my directory structure under /serendipity/, this is all I see:

bundled-libs
deployment
docs
htmlarea
include
lang
comment.php
exit.php

That's it! Now, I KNOW there were more folders than that yesterday. I can change the style of serendipity, and those changes are reflected when I refresh. So, can I conclude the template directories are there, but I cannot see them for some reason?

As a reminder - I cannot use an FTP client to view the server - I must use Microsoft FrontPage only, or the permissions get all screwed up (been there, done that, had to reinstall FrontPage extensions).
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Well, I'm on the phone with tech support (godaddy) and they can see all the files and folders - the data is still there, as I suspected, I just cannot see all of it for some reason. They are looking into whether it is related to another ticket I opened yesterday. Any of you server gurus have any suggestions?
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Wow. We can't even use FTP to access the non-FrontPage files?

Can FrontPage access the Serendipity files? Will it mess them up when it uploads them again?

You can skip the template modifications, and simply remove all the plugins from the sidebars. You'll still have a banner, but that's not too bad. Maybe we can even figure some way around it.
Judebert
---
Website | Wishlist | PayPal
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

As I understand it, ANY FTP access will screw up the FrontPage Extensions, and I proved that a few days ago. Reinstalling the extensions solved the problem.

I can "reverse publish" the Serendipity files from the server to my local computer, make changes as needed, then publish them back. I was about to do that when I noticed that I cannot see several files and folders. This is not due to FrontPage - something funky is going on with the server, and I am totally dependent on godaddy to figure it out.

While I wait for that ticket to be resolved, I did take a peek at your suggested template. This stuff is way over my head, but I am trying to digest it.

First question, is the primary output coming from the {$CONTENT}, and if so, can I dump that into a table?

Also, don't I need to remove the link to the style sheet so that it does not conflict with the way I want the output to look?

Finally for now - I installed Serendipity via godaddy, which means, I didn't install it at all - they did. It is version 0.8.2. Should I upgrade that to 0.9.1??? And if so, any idea as to how that is going to work in my FrontPage environment? I'm thinking I create a subfolder within my local FrontPage web, then perform a FrontPage publish, which I assume would overwrite everything already on the server, but I am not sure.
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

1) Yup, the basic blog content is in {$CONTENT}. It can be stuck in a table, and our default template does exactly that.

2) Ooops! Yes, you should remove the stylesheet link. Otherwise you'll get some Serendipity themeing on the Serendipity content.

3) Ohh, ick. Yes, upgrading to 0.9.1 is recommended. Or, better yet, waiting for the 1.0 release coming up soon. I don't know how FrontPage publishing works, but if it can overwrite all the files already in the 0.8.2 blog directory, you can then access the Serendipity admin page to upgrade automatically and painlessly.
Judebert
---
Website | Wishlist | PayPal
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Thanks again judebert. Using FrontPage, I can tell it to overwrite everything already on the destination. However, doing so will not delete anything that doesn't get updated. For instance, if there is a file 123.php already there, and that file does not exist in the upgrade, it will still be there once I overwrite the other files. At least, that's how I think it works.

My server problems appear to be MS FrontPage specific. If I use FTP, I see the correct structure. They told me I can VIEW the server with FTP, just not use it to change anything, otherwise I will screw up all the links.

So, they dropped the ball back in my lap.

I'll keep working on this stuff, but another question comes to mind - before I go about changing any files already on the server, should I first copy the default template directory to something with a new name, somehow creating my own "theme"???? That way, I can easily return to the default if what I am doing is either prone to errors, or simply doesn't work correctly.
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

judebert - to make the best of your valuable time, I thought I would post an update.

First, I am still having difficulties viewing my server files. All signs point to FrontPage extensions, but being no expert, I have no real idea. I deleted a bunch of files, removed & reinstalled FP extensions, but am still having difficulties. I might have godaddy.com blow everything away, and start from scratch. That that is not our concern here, so scratch it from the list (unless someone else has valuable input on this).

Next, I was able to install 0.9.1 - piece of cake. Downloaded the archive, expanded it to a folder, then copied that folder into my FrontPage local web, then published. First access to Serendipity (I always seem to want to call it "serenity"), launched the upgrade script. Worked just fine, so that is now off the table.

I copied the contents of the "default" template to a new folder, and edited the info.txt file, and now that appears as a new style in the admin panel. I will move forward editing things from that folder so I can always return to the previous "default" if the $hit hits the fan. So that is off the table.

Now I am at the point of modifying existing files, and trying to get this sucker to work. Remember - I have never used FrontPage to any real degree, have virtually no knowledge of HTML, php, css, or any of this stuff - just happen to have an end result in mind, and am moving forward as best I can.

If you have input before I post again, feel free - as I might not have covered all my open issues from prior posts. Meanwhile, if the kids will leave me alone long enough, I will see what else I can accomplish tonight.

I love this stuff!!!!!
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Good luck! I've got kids too; I never get anything done before bedtime, except in two-minute chunks.

That's part of Serendipity's beauty: updating is just too simple.

Backing up the default template is exactly the right thing to do.

Let us know when you run into your next question!
Judebert
---
Website | Wishlist | PayPal
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Looks like you posted while I was just about to ask another question.

Based on your original reply in which you supplied a modified index.tpl file, it occurs to me that I might not be on the right track.

Am I adding further modifications to a custom index.tpl file (starting with your example), or am I leaving that alone AS the index.tpl file, and trying to implement one of the embedding suggestions????
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Eh, either way, really.

My "custom" index.tpl is just a modification of the original index.tpl, with the sidebars and banner removed. You could make your own modifications, of course.

I've been thinking about it some more, and I'd leave the style link in. Your page doesn't know how to style Serendipity classes, and you'd probably like to have SOME styling. By changing the default/index.tpl, you're also changing it for any template that doesn't specifically create its own (most of them). So most themes you would choose would then get your index.tpl with no banner. (There are exceptions, of course: practically anything that puts in curves, menus, etc.)
Judebert
---
Website | Wishlist | PayPal
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

OK - I gather from other things I have read that your suggestion, is itself, a replacement for the index.tpl file.

Then I need a wrapper.php file:

<?php
ob_start();
chdir("<serendipity_dir>");
require("index.php");
chdir("<original_dir>");
$serendipity_contents = ob_get_contents();
ob_end_clean();
?>

Then, it looks like I will create my own php (NOT html) file, with all my own formatting, which will then write the $serendipity_contents where I want it:

<?php
require("<full_path>/serendipity_wrapper.php"); // stores S9Y in a variable
?>
<!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=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
Your non-Serendipity content goes here.
<?php
echo $serendipity_contents; // Print the variable
?>
More non-Serendipity content here.
</body>
</html>

Regarding the wrapper file:
1) Where should this file be located? My installation is www/mydomain.com/serendipity/
2) Is the path absolute (/home/content/...etc), relative (/serendipity/), or should it contain the full URL (http://www.mydomain.com/serendipity/)?
3) Are the brackets part of the path, or just part of the example?
4) Same questions for original directory.

Also let me know if I am on the right track.... again, I really have no experience in this stuff, but I think I am catching on.
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

judebert - my last reply was being written when you posted yours just before, so I didn't see it.

Instead of modifying the index.tpl, how about if I just select "hidden" for the side bar stuff? Not sure what that will look like within my page, but it could be a start.
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

You're definitely getting it. Not much further to go now.

"Hidden" will work for hiding the sidebars. You can even uninstall the sidebar plugins, if that suits your fancy. The banner will still be left over, of course, but it is a start, as you say.

As for the other questions:

1) Since the wrapper switches to the S9Y directory, you can put it anywhere. I usually leave it in htdocs/ or serendipity/.

2) <full path> can be either relative or absolute, as long as it gets you to the wrapper. PHP uses the disk, not the browser, so you can't use the http:// form.

3) The brackets merely indicate what needs to be replaced. Since PHP uses the same brackets, I'd better switch them sometime to make it more understandable. Maybe "your_full_path" or something.

4) Same answer for original_dir. Notice that this implies that the wrapper should really only be called from one location.

The file CAN be an html file, IF you modify your .htaccess to parse them as PHP files. The idea is that you can call the wrapper from your existing pages and insert the data anywhere you want it.
Judebert
---
Website | Wishlist | PayPal
Post Reply