Calling colorz with variables
Hi Mr. Colorz, I'm just trying to call colorz with variable input. I want to use the colorscheme with different colors in one dtml-tag. What is the syntax. Thanks Harry
Hi Harald, "colorz", also called "colors" or "colours" ;) are like any other tag attribute. Nothing special. Like <a href="&dtml-var-blahfasel;"> is <body bgcolor="&dtml-var-mycolor;"> Or, if you like the full uglyness of DTML, you can write <body bgcolor="<dtml-var mycolor>"> But you should not use DTML anyway. Proper syntax would be: <p tal:attributes="class here/paragraphclass1"> or such like. (Using CSS of course) What are you actually trying to do? Alternating colors in a table? Regards Tino --On Freitag, 29. November 2002 09:11 +0100 Harald Winkelmann <winkelmann@fh-weingarten.de> wrote:
Hi Mr. Colorz,
I'm just trying to call colorz with variable input. I want to use the colorscheme with different colors in one dtml-tag. What is the syntax.
Thanks Harry
_______________________________________________ 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 )
Hi Tino, That's not what i ment. I want to use colorz instead of <dtml-var "colorz.main1_60_40"> like <dtml-var "colorz(variable)"> I tried it via a script, but i always get an error in __getitem__ The script is just return context.colorz['main1_60_40'] Any ideas Harry
Hi Harald,
"colorz", also called "colors" or "colours" ;) are like any other tag attribute. Nothing special. Like <a href="&dtml-var-blahfasel;"> is <body bgcolor="&dtml-var-mycolor;"> Or, if you like the full uglyness of DTML, you can write <body bgcolor="<dtml-var mycolor>">
Hi Mr. Colorz,
I'm just trying to call colorz with variable input. I want to use the colorscheme with different colors in one dtml-tag. What is the syntax.
Thanks Harry
Harald Winkelmann wrote:
Hi Tino,
That's not what i ment. I want to use colorz instead of
<dtml-var "colorz.main1_60_40">
like
<dtml-var "colorz(variable)">
I tried it via a script, but i always get an error in __getitem__ The script is just return context.colorz['main1_60_40']
return getattr(colorz, 'main1_60_40') HTH, __Janko
Tino Wildenhain wrote:
Hi Harald,
"colorz", also called "colors" or "colours" ;) are like any other tag attribute. Nothing special. Like <a href="&dtml-var-blahfasel;"> is <body bgcolor="&dtml-var-mycolor;"> Or, if you like the full uglyness of DTML, you can write <body bgcolor="<dtml-var mycolor>">
But you should not use DTML anyway. Proper syntax would be:
<p tal:attributes="class here/paragraphclass1">
or such like. (Using CSS of course)
What are you actually trying to do? Alternating colors in a table?
I'm guessing he's trying to use that gem: http://www.zope.org/Members/maxm/productList/colorz Not that I could offer any help, just had the suspicion that this information might prevent some confusion on your side. ;) cheers, oliver
Hi Oliver, --On Freitag, 29. November 2002 11:36 +0100 Oliver Bleutgen <myzope@gmx.net> wrote:
thanks! I didnt know of this product and now I know where the funny z comes from :-) (and not from "31337" writing ;)) While the use of the color theorem for generating the colors I would anybody recommend using this with a stylesheet, instead of modyfying the HTML code everywhere (should have impact on speed) Regards Tino
Tino Wildenhain wrote:
thanks! I didnt know of this product and now I know where the funny z comes from :-) (and not from "31337" writing ;))
It is called Colorz because: - The Z in Zope - It makes it a name and not a concept - I wanted to avoid using "colors" as default id, as I could easily imagine somebody having used it for their own stuff
While the use of the color theorem for generating the colors I would anybody recommend using this with a stylesheet, instead of modyfying the HTML code everywhere (should have impact on speed)
That might be premature optimisation. I haven't tested it for speed, but once loaded from disk it should be pretty fast compared to all the other things that takes place in Zope. regards Max M
maxm wrote:
Tino Wildenhain wrote:
thanks! I didnt know of this product and now I know where the funny z comes from :-) (and not from "31337" writing ;))
It is called Colorz because:
- The Z in Zope
- It makes it a name and not a concept
- I wanted to avoid using "colors" as default id, as I could easily imagine somebody having used it for their own stuff
- j00 w4nt3D 4N E45y w4Y T0 4++r@Ct L33+ H4CKEr5 SCNR, oliver
Harald Winkelmann wrote:
Hi Mr. Colorz,
I'm just trying to call colorz with variable input. I want to use the colorscheme with different colors in one dtml-tag. What is the syntax.
Ok ... I understand what you are trying to do, and it is pretty trivial to add a method to the next version that can be called like:: <dtml-var "colorz.getcolor('main', 100, 90)"> Would that suffice? regards Mr Max Mr Colorz ;-)
Harald Winkelmann wrote:
Hi Mr. Colorz,
I'm just trying to call colorz with variable input. I want to use the colorscheme with different colors in one dtml-tag. > What is the syntax.
Ok ... I understand what you are trying to do, and it is pretty trivial to add a method to the next version that can be called like::
<dtml-var "colorz.getcolor('main', 100, 90)">
Would that suffice?
That's it ! I have a Navigation Document, which should change ist color depending of the place from which it is called. When do you colorz again ? :) Harry
participants (5)
-
Harald Winkelmann -
Janko Hauser -
maxm -
Oliver Bleutgen -
Tino Wildenhain