Support » Plugins » EzStatic Plugin

  • I know there are a bunch of static-making plugins out there, but I thought I would toss this out as an easy (if inefficient) way to implement static pages.
    Get a copy of EzStatic.php and put it in your plugins directory. Activate it.
    Put a file in your web root (same directory as index.php). It can be html or php. Take the base name of the file (for “test.php” use “test”) and incorporate it into a URL like so:
    The plugin will find your file, execute it, and embed it into your WP template. If your file was a php file, you can even use WP functions inside it.
    No messy file editing or deleting, just activate the plugin. Another proof of concept plugin from yours truly. Enjoy!

Viewing 15 replies - 1 through 15 (of 160 total)
  • Aww, man! Now I have to unkludge my handmade static pages.
    Seriously, worked great at 1.0 on a few pages, will test a few more. btw, it is not idiot proof yet, it didn’t work at first, until I noticed that .html wasn’t an option in the search path.
    idiot —> Xyth

    I take it that it is suppose to put the static page into the contents section. If that is the case it did not work for me. I installed it, and then activated it. I created an htm document. When I directed it to display the document I created the text was not situated in the content area but all over the page. I also tryed it with a php file.

    Ringmaster, I think your missing a division tag set: I manually added <div id=”content”> at the top of my code and </div> at the end and all formating was fixed.

    Which file did you put that in: the .html file or the existing index.php file? It already exists in my existing index.php file.

    Thanks for clarifying Xyth!

    The .html file. The index.php remains unmodified. I created a .php file with no header or footer info, just tables and text. Also did a .htm file. .HTML is not a valid extension in this version, as it was not included in the search path, although it can be added.

    I got it to work. I love this!

    I finally got around to validating XHTML 1.0 and noticed I had an extra closing tag </div> that wasn’t needed. Looks like only the opening tag is missing. Sorry for the error.
    I suspect Ringmaster will edit the code to eliminate even the opening tag, but until 1.1, the work around seems valid.

    Yeah, it was a quickie job, to be sure. About 40 minutes of coding and a rush to get it on-site before I left for a dinner engagement.
    If it’s not working, I should mention that you need to have something close to the default index.php page. You need to have a div defined as <div id="content"> that contains your post content (duh) followed immediately by a div defined as <div id="menu">. The plugin basically cuts all of that out and replaces it with your static stuff. It should replace the content div, and if it’s not, I’ll need to fix that in 1.1. Everything the plugin writes should validate in the end – that is my goal.
    You can pretty easily add support for .html as an extension, and I’ll include that in 1.1 too.

    What 1.0 seemed to do was take the index.php and cut out everything from and including the the <div id”content”> to the <div id=”menu”> tag, putting back in the new content and the closing tags, but omitted adding back in the <div id”content”> tag.
    A great future enhacement would be the ability to add content between the head tags in addition to the content section. Some pages could use this, like adding temporary CSS info for that page only, or javascript.
    Great job.

    Bah, the post above is mine, forgot to log in.

    What tags do you suggest that it capture from the source file for inclusion?
    Anything redundant (already appearing in the WP index.php) might have to be omitted – such as the Title tag. I could probably coerce the title into the page using Javascript, but I don’t think I can remove the old title tag for technical reasons, and adding a second one would cause the page not to validate.
    I’ll give it some thought before releasing the fixes in 1.1.

    Ok, 1.1 is online.
    I fixed the div issue. You don’t need to re-add this div to your own code.
    I added the ability to transplant the head from the static page to the WordPress output. It removes the <title> tag and uses Javascript to change the existing title based on the title in the static file.
    I added .html and .txt as static target files. If you didn’t delete your license.txt from your WordPress install, you should be able to read it inside your WP template using:

    same as Xyth

    Oops. I zipped my test server code instead of the release server code.
    Try 1.1a for a copy with my debugging stuff removed.
    To use a title on the static page, you have to put the title in a head tag. You know, make a working HTML page with a title. EzStatic will take everything inside the head tag and put it in the head tag of your WP page.
    Here’s an example of how it was designed to work, with links to the PHP source of the embedded page and XHTML checkers that show it’s valid:
    Of course, if you reference a file that doesn’t have a <head> section then the head is not included. If you reference a file that does not have a <body> section, then it simply embeds the entire file. If you stick a <title> tag somewhere in a random text file, it does nothing – the <title> has to be in a <head> tag.
    Sorry I didn’t make this clear before.

Viewing 15 replies - 1 through 15 (of 160 total)
  • The topic ‘EzStatic Plugin’ is closed to new replies.