I am trying to add build a small site using Zope that will have the option of viewing a text only version as well. I have created a standard_html_header which also contains objects for the site logo and navigation information. These are the only graphics on the site. My question is, do I need to create a separate header for the text version, or is there a way that Zope can determine what page is calling the header and then insert the proper object? ie: index_text_html is calling standard_html_header so "text_logo" and "text_navbar" gets called. Or, index_html is calling the standard_html_header so "graphic_logo" and "graphic_navbar" gets called. I'm not real good at explaing things, I hope you can understand all of this;-) Thanks, Michael
I have been thinking for a while in the best solution to do it. I had a lot of good ideas, but I asked my self, why do it?. You can have a standard_text_html_header with the <dtml-var text_logo><dtml-var text_navbar>. But, here we go with one of my ideas (The easy way). Overwrite standard_html_header adding this: <dtml-if expr="id=='index_text_html'"> <dtml-var text_logo> <dtml-var nav_bar> <dtml-else> <dtml-var graphic_logo> <dtml-var graphic_navbar> </dtml-if> Voila!, But I do think is better de first solution. Antonio Carrasco www.udiberica.com acarrasco@udiberica.com "If you look heedfully Reality, you may see pixels". ----- Original Message ----- From: "Michael" <michael@exasource.com> To: <zope@zope.org> Sent: Monday, September 17, 2001 11:47 PM Subject: [Zope] Newbie Question
I am trying to add build a small site using Zope that will have the option of viewing a text only version as well. I have created a standard_html_header which also contains objects for the site logo and navigation information. These are the only graphics on the site. My question is, do I need to create a separate header for the text version, or is there a way that Zope can determine what page is calling the header and then insert the proper object?
ie: index_text_html is calling standard_html_header so "text_logo" and "text_navbar" gets called. Or, index_html is calling the standard_html_header so "graphic_logo" and "graphic_navbar" gets called.
I'm not real good at explaing things, I hope you can understand all of this;-)
Thanks,
Michael
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Sun, 16 Sep 2001, Antonio Carrasco wrote:
But, here we go with one of my ideas (The easy way). Overwrite standard_html_header adding this:
<dtml-if expr="id=='index_text_html'"> <dtml-var text_logo> <dtml-var nav_bar> <dtml-else> <dtml-var graphic_logo> <dtml-var graphic_navbar> </dtml-if>
Antonio, Thanks for responding. I had tried the following before I wrote to the list. <dtml-if expr="index_text_html"> <dtml-var text_logo> <dtml-else> <dtml-var graphic_logo> This only displays the first statement, or text_logo. When I tried <dtml-if expr="id==' index_text_html;"> <dtml-var text_logo> <dtml-else> <dtml-var graphic_logo>, it only displays the last statement.or graphic_logo. I guess I will just have to stick with two headers. I just wanted to see if dtml had the capability to determine which page was making the call and display the proper object. It seems as though this might come in handy other places and make larger sites more maintainable. No big deal though, I'll just use two headers Thanks, Michael
Michael writes:
I am trying to add build a small site using Zope that will have the option of viewing a text only version as well. I have created a standard_html_header which also contains objects for the site logo and navigation information. These are the only graphics on the site. My question is, do I need to create a separate header for the text version, or is there a way that Zope can determine what page is calling the header and then insert the proper object? When you put your text only version into its own subtree, than you can use a property on its root object, say "text_only", to check whether you are in a "text_only" context. Thanks to acquisition, all object in the subtree see the property while objects outside do (usually) not.
Alternatively, "REQUEST['PUBLISHED']" contains the "called" object. Dieter
On Tue, 18 Sep 2001, Dieter Maurer wrote:
When you put your text only version into its own subtree, than you can use a property on its root object, say "text_only", to check whether you are in a "text_only" context. Thanks to acquisition, all object in the subtree see the property while objects outside do (usually) not.
Thanks, Dieter. It works great! I'll see if i can find some other uses for this. Michael Lewis "Linux - The final solution"
participants (3)
-
Antonio Carrasco -
Dieter Maurer -
Michael