interface.html

The interface.html file acts as the template that generates pyBlog's interface. This file is broken up into 3 sections using pyBlog tags that represent input pages, output pages, and the universal user interface. Below is the pyBlog tag hierarchy of the whole file:

#Input page section
<!--pyBlog input--> #Encompassing tag
    <!--pyBlog chunk--> #Contains each chunk's XHTML
        <!--pyBlog title--> #Title for form input
            <!--pyBlog insert/--> #Insertion point
        <!--pyBlog /title-->
        <!--pyBlog form--> #XHTML for from input tag
            <!--pyBlog insert/--> #Insertion point
        <!--pyBlog /form-->
    <!--pyBlog /chunk-->
    <!--pyBlog controls--> #XHTML for controls specific to chunks
        <!--pyBlog insert/--> #Insertion point
    <!--pyBlog /controls-->
<!--pyBlog /input-->



#Output page section
<!--pyBlog output--> #XHTML for output section.
    <!--pyBlog chunk--> #XHTML for entire chunk.
        <!--pyBlog select--> #XHTML for form selection tag.
            <!--pyBlog insert /--> #Insertion point for form tag(s)
            <!--pyBlog count /--> #Insertion point for number of pieces of info per chunk (used mainly for rowspan for <select>'s  tag)
        <!--pyBlog /select-->
        <!--pyBlog info--> #XHTML for information.
            <!--pyBlog insert /--> #Insertion point for info.
        <!--pyBlog /info-->
    <!--pyBlog /chunk-->
    <!--pyBlog controls--> #XHTML for controls specific to chunks
        <!--pyBlog insert/--> #Insertion point
    <!--pyBlog /controls-->
<!--pyBlog /output-->



#UI section
<!--pyBlog UI-->
<!--pyBlog /UI-->

You might notice that both the input and output page sections contain the tag <!--pyBlog chunk-->. A chunk is a unique piece of info. You might also have noticed that <--pyBlog insert/--< is used frequently. That tag is used for where text is to be inserted.

Input page

The input page section of the file is used for generating any interface page that has you inputted info (mainly login.py, search.py, and post.py). The title tag is the code that will be used to generate the HTML for the title for the form info. The form tag contains the HTML for the actual form field code. The controls tag contains the HTML for where the buttons for the form is inserted.

Output page

The output page section is used to generate any output pages (select.py, visible.py). The select tag encompasses the HTML for the radio button for the chunk. The count tag is replaced with the number of items in the chunk. This is mainly used so as to have the radio button line up next to all the info fields for a single chunk. Speaking of info, the info tag encloses the HTML for each piece of info for the chunk. The controls tag works just as it does for the input page page; it is where controls specific to the page are placed.

UI

The UI section holds the UI HTML. Now this is HTML is static and has no dynamic creation. This is to allow you to have rather involved HTML for the interface of pyBlog that are constant across all pages. It is also so that if you use any external modules (such as an epilogue/prologue module) that requires their own access point on all pages you can easily put that HTML code here and have it accessible no matter where you are in pyBlog.

If this seems complicated, then just look at the example template that comes with pyBlog to get an idea of how it all works out. The hardest part is figuring out how to get the HTML code that is constantly repeated to work the way you want. The best I have found to figure that out is to write up a test page with all of your HTML written out by hand. You can then notice what gets repeated and use that info to figure out where to put your pyBlog tags.

Also, if you are a programmer and are familiar with XML, then you can easily relate this to XSLT.

pyBlog 1.0; 2001-09-02