Include statements with python scripting

William Tanksley wtanksle at dolphin.openprojects.net
Fri Jul 30 21:37:58 EDT 1999


On Fri, 30 Jul 1999 17:18:45 -0400, Sean Robertson wrote:
>William Tanksley <wtanksle at dolphin.openprojects.net> wrote in message

>> On Fri, 30 Jul 1999 15:24:38 -0400, Sean Robertson wrote:
>> >How do you do an include statement in python?  I know that in Cold Fusion
>it

>> ><html><head><title><!--#var name--> Search Results</title></head>

>> This isn't Python -- I'm sure you're trying to ask about Zope.  Remarkable

>> I wasn't aware of a #include in Zope; I've been using #var.  Generally
>> speaking, it doesn't make any sense to include an entire HTML page inside
>> another, so I think you might possibly be confused.

>I was told that the program that uses this template uses python, but am
>checking out zope nonetheless.

The program that reads that template is Zope, and uses Python.
Nonetheless, that template isn't written in Python :).

>The reason I need to include and external
>html fragment is that I want the page to have two seperate interfaces
>depending on which part of the site the user is coming from.  If they are
>searching CareerConnection, the mainclass variable will be Employers and the
>results page needs to fit the interface of the CareerConnection site,
>otherwise, they should get the old default interface.  I was using
>"#include" only as a placeholder until I figured out how to do it in python.
>If you know how, please let me know.

It depends on your environment, and the Zope people will be able to help
you a lot more, but my Zope website uses things like:

<!--#var page_header-->

to handle that kind of thing.  The correct page header is automatically
inserted there depending upon where you are -- no need for ifs.  Look up
an example of 'acquisition' in the Zope docs.

Once you learn it (and it's easier than it looks), you'll never look back.

-- 
-William "Billy" Tanksley




More information about the Python-list mailing list