Re: [Zope] I Got the Concatenation Blues
On Sunday 11 November 2001 16:12, Ben Ocean wrote:
Hi; I've built a site with inline frames. Each page has one inline frame that bears the same name as the page calling it with the tag *_frame*. I want to code into my template a way to call the dtml document and render it within a noframes tag in the calling document. I have created a Python method called concatFrame.py:
import string
def concatFrame(str): frame = string.join(str,'_frame') return frame
I'm trying to call it thusly:
<dtml-var "concatFrame(title_or_id())">
It ain't working. What do I need to do?
1.) "title_or_id()" returns a string. 2.) "concatFrame(a_string)" returns another string 3.) <dtml-var "this_new_string_which_actually_is_an_id"> will probably return your document html quoted :-o Try <dtml-var "_[this_new_string_which_actually_is_an_id]"> to render your document So it's: <dtml-var "_[concatFrame(title_or_id())]"> hth, Danny
Hi! I guess Ben solved his problem the easier way (without the method involved). But still I'd like to comment on this for the record: I have created a Python method
called concatFrame.py:
import string
def concatFrame(str): frame = string.join(str,'_frame') return frame
I'm trying to call it thusly:
<dtml-var "concatFrame(title_or_id())">
It ain't working. What do I need to do?
1.) "title_or_id()" returns a string. 2.) "concatFrame(a_string)" returns another string 3.) <dtml-var "this_new_string_which_actually_is_an_id"> will probably return your document html quoted :-o
Not quite. "<dtml-var "concatFrame(title_or_id())">" will pass the title_or_id as string, which is good. Then it will add "_frame" to the string and then display the STRING ... ;-)
<dtml-var "_[concatFrame(title_or_id())]">
Correct ... Cheers Joachim
participants (2)
-
Danny William Adair -
Joachim Werner