Can anyone help me figure out how to include an external HTML fragment? Here is the basic code fragment, with (obviously) incorrect include statements. I looked at the docs, but am having a hard time making sense out of it. <!--#if mainclass == Employment--> <!--#include http://data.pilotonline.com/connect2/blue_header.html--> <!--#else:--> <!--#include http://data.pilotonline.com/connect2/default_header.html--> <!--#/if--> Sean Robertson Multimedia Artist, PilotOnline seanr@infi.net
At 05:47 PM 7/30/99 -0400, Sean Robertson wrote:
Can anyone help me figure out how to include an external HTML fragment? Here is the basic code fragment, with (obviously) incorrect include statements. I looked at the docs, but am having a hard time making sense out of it.
I'm not sure what you mean by "external HTML fragment". If you are referring to DTML Method or DTML Document objects, the normal way to include them is to use the 'var' tag. If you are talking about HTML resources on remote servers, Zope doesn't have any built-in methods for fetching them and putting them in your templates, though it would be quite simple to write an external method to do this with python's standard urllib module: import urllib def fetch_url(self, url): """fetch content from a remote url and return it as a string""" return urllib.urlopen(url).read() Hope this helps. -Amos
In article <011901bedad5$2a8808c0$6e3461d1@pilotonline.com>, Sean Robertson <webolutionary@webolutionary.com> writes
<!--#if mainclass == Employment--> <!--#include http://data.pilotonline.com/connect2/blue_header.html--> <!--#else:--> <!--#include http://data.pilotonline.com/connect2/default_header.html--> <!--#/if-->
<!--#if expr="mainclass=='Employment'"--> <!--#var blue_header_html--> ------- Regards, Graham Chiu gchiu<at>compkarori.co.nz
Sean Robertson wrote:
Can anyone help me figure out how to include an external HTML fragment? Here is the basic code fragment, with (obviously) incorrect include statements. I looked at the docs, but am having a hard time making sense out of it.
<!--#if mainclass == Employment--> <!--#include http://data.pilotonline.com/connect2/blue_header.html--> <!--#else:--> <!--#include http://data.pilotonline.com/connect2/default_header.html--> <!--#/if-->
Although there is an #include tag in SSI that does this exact thing, Zope does not use SSI, just the same *syntax*. It would be fairly useful to include something like this in Zope. It was not done in the past because Zope was single threaded, and a call like this could quickly block Zope if the URL the tag pointed to was slow or not responding. Now that Zope is multithreaded, I think it's a good idea. Anyone? -Michel
Sean Robertson Multimedia Artist, PilotOnline seanr@infi.net
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
participants (4)
-
Amos Latteier -
Graham Chiu -
Michel Pelletier -
Sean Robertson