[Zope] newbie - create and call methods ?

Olivier Deckmyn odeckmyn.list@teaser.fr
Wed, 15 Mar 2000 18:51:07 +0100


What I know is that you have to use Named Parameters in method

ex:
myFunction(url, image):
    return '<A HREF=%s><IMG SRC=%s></A>' % (url, image)

and the dtml call looks like :

<dtml-var "myFunction(url='http://www.zope.org', image='logo.gif')">

I am not sure of all...But I think it is the "spirit"...

Good luck !

----- Message d'origine -----
De : Eric Simoëns <Eric.Simoens@inpg.fr>
À : <zope@zope.org>
Envoyé : mercredi 15 mars 2000 18:25
Objet : [Zope] newbie - create and call methods ?


> Hello all,
>
> I've been looking in the available zope documentation, listening to
> this list, looking in the archive of this list (BTW : are you planning
> to add a keyword search ?)... That is to say that I'm used to
> searching for the info about open source OS and applications, but I
> have to admit I'am almost discouraged using Zope as the doc is really
> scarse compared with what is usually found.
>
> So, sorry, I post my newbie questions :
>
> I would like to create a method to generate a link (href) with a
> leading image and text formatting, and so on. I'd like the method to
> have two arguments : the name of the link and the URL.
>
> How do I create a method with arguments ?
> How do I call a methods with arguments ?
> Do I mistake attributes (for docs but not for methods) and arguments ?
>
> If you have pointers to documents I haven't found that...
>
>
> Thanks in advance,
> Greetings,
> Eric
>
>
> PS: Here is what I tryed:
> --- DTML method "meth_link"
> <h2>
>   <dtml-var img_puce_paragraph>
>   <a href= "<dtml-var link_url>">
>   <dtml-var link_name>
>   </a>
> </h2>
>
> --- in an other method
> <dtml-var name="meth_link" link_name="foo" link_url="la_url">
>
> --- Zope error
> Invalid attribute name, "link_name", for tag <dtml-var
> name="meth_link" link_name="foo" link_url="la_url">, on line 6 of
> txt_user_content
>
> _______________________________________________
> 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 )
>
>