getitem('string') but with HTML
I have a rather simple setup. And all I want to do is to show some news content, but with the way I'm doing it, the HTML is not parsed. /root index_html view_each_news_html /news news_001 (MS ruined!) # a DTML Document news_002 (Peter on killin spree) # a DTML Document ... # lots of DTML Documents Index_html lists all available news and that works fine. All I do is that I list the documents' title together with their bobobase_modification_time. Each news item is linked as <a href="/news_folder/view_each_news_html?newsID=<dtml-var id>"><dtml-var title></a> In view_each_news_html: I first tried this: <dtml-var "_.getitem(newsID)"> But it didn't parse the HTML in it. Static view works. For example changing: <dtml-var "_.getitem(newsID)"> to <dtml-var news_002> I have tried both: <dtml-with news> <dtml-var "_.getitem(newsID)"> </dtml-with> And... <dtml-with "_.getitem(newsID"> <dtml-var "_.getitem(newsID)"> </dtml-with> But none worked. Question is, how do I render with the getitem() function? so that HTML is HTML and not just text (html_quote)?? Grateful, Peter
peter be wrote:
I have a rather simple setup. And all I want to do is to show some news content, but with the way I'm doing it, the HTML is not parsed.
/root index_html view_each_news_html /news news_001 (MS ruined!) # a DTML Document news_002 (Peter on killin spree) # a DTML Document ... # lots of DTML Documents
Index_html lists all available news and that works fine. All I do is that I list the documents' title together with their bobobase_modification_time.
Each news item is linked as <a href="/news_folder/view_each_news_html?newsID=<dtml-var id>"><dtml-var title></a>
why use getitem wouldn't an objectItems be more what you want. from root in index_html <dtml-in "news.objectItems(['DTML Document']"> <dtml-with sequence-item> <a href="<dtml-var absolute_url>"><dtml-var title></a> <dtml-var bobobase_modification_time> </dtml-with> </dtml-in> OR getitem takes an optional arg. on whether it should call the item or just get a reference try _.getitem(item, 1) check the Zope Quick Reference for more info http://www.zope.org/Members/ZQR Cheers Kapil
Yeah! It worked. I didn't use you dtml-in at all, and I guess you didn't understand my unwell-formated question. However, getitem(arg,1) worked! Can somebody tell me the difference between: _.getitem(arg) and _.getitem(arg,1) ?? And what does _.getitem(arg,n) do? Where n is 0,1,2,3,4,... ----- Original Message ----- From: Kapil Thangavelu <kvthan@wm.edu> To: peter be <peter@grenna.net> Cc: <zope@zope.org> Sent: Wednesday, August 09, 2000 12:16 AM Subject: Re: [Zope] getitem('string') but with HTML
peter be wrote:
I have a rather simple setup. And all I want to do is to show some news content, but with the way I'm doing it, the HTML is not parsed.
/root index_html view_each_news_html /news news_001 (MS ruined!) # a DTML Document news_002 (Peter on killin spree) # a DTML Document ... # lots of DTML Documents
Index_html lists all available news and that works fine. All I do is that I list the documents' title together with their bobobase_modification_time.
Each news item is linked as <a href="/news_folder/view_each_news_html?newsID=<dtml-var id>"><dtml-var title></a>
why use getitem wouldn't an objectItems be more what you want.
from root in index_html
<dtml-in "news.objectItems(['DTML Document']"> <dtml-with sequence-item> <a href="<dtml-var absolute_url>"><dtml-var title></a> <dtml-var bobobase_modification_time> </dtml-with> </dtml-in>
OR
getitem takes an optional arg. on whether it should call the item or just get a reference
try _.getitem(item, 1)
check the Zope Quick Reference for more info
http://www.zope.org/Members/ZQR
Cheers Kapil
_______________________________________________ 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 Wed, 09 Aug 2000, peter be wrote:
Yeah! It worked. I didn't use you dtml-in at all, and I guess you didn't understand my unwell-formated question.
However, getitem(arg,1) worked!
Can somebody tell me the difference between: _.getitem(arg) and _.getitem(arg,1) ?? And what does _.getitem(arg,n) do? Where n is 0,1,2,3,4,...
From the Zope Quick Reference:
getitem(name,flag) Lookup a name in the namespace. If the value is callable and the flag is true, then the result of calling the value is returned, otherwise the value is returned. flag defaults to false. Well worth keeping a copy on hand, IMHO. (o8 Have a better one, Curtis.
participants (3)
-
Curtis Maloney -
Kapil Thangavelu -
peter be