Discussion:
TALES expressions and conditions
jeronimo
2013-02-05 17:54:45 UTC
Permalink
jeronimo [http://community.zenoss.org/people/jeronimo] created the discussion

"TALES expressions and conditions"

To view the discussion, visit: http://community.zenoss.org/message/71386#71386

--------------------------------------------------------------
I've been experimenting with learning TALES in my notifications and am confused as to why some stuff isn't working.  There doesn't seem to be any good in-dept documentation of TALES in the context of zenoss beyond just the "here are the attributes you can use".

Here are a couple of my examples.  They're mainly academic at this point.  These examples are put in the notification for an event trigger:

<b tal:condition="python: int(evt.eventState) == 0">State is hopefully 0 = ${evt/eventState}</b><br>
<b tal:condition="python: int(evt.eventState) == 3">State is hopefully 3 = ${evt/eventState}</b>

It doesn't seem to do anything I expect.  It always outputs both lines, no matter of the eventState.  For example:

State is hopefully 0 = 0
State is hopefully 3 = 0

Another example I tried:

<b tal:condition="evt/eventState == '0'">State is hopefully 0 = ${evt/eventState}</b><br>
<b tal:condition="evt/eventState == '3'">State is hopefully 3 = ${evt/eventState}</b>

Same result as above, but I never could find any confirmation that you could use a comparison operator like that directly on the TALES attribute without using python:, so I'm not as surprised by this one.

So the question is basically how to do what I'm trying to do here with comparisons.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/71386#71386]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jeronimo
2013-02-12 19:40:28 UTC
Permalink
jeronimo [http://community.zenoss.org/people/jeronimo] created the discussion

"Re: TALES expressions and conditions"

To view the discussion, visit: http://community.zenoss.org/message/71489#71489

--------------------------------------------------------------
Nobody?  Does zenoss just not support anything but the stuff here?
http://community.zenoss.org/docs/DOC-3879 http://community.zenoss.org/docs/DOC-3879
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/71489#71489]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2013-02-15 18:14:18 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: TALES expressions and conditions"

To view the discussion, visit: http://community.zenoss.org/message/71537#71537

--------------------------------------------------------------
jeronimo:

Not sure a Tal condition will work on <b blah></b>. Try <div tal:condition='blah'></div> or <tal:block tal:condition='blah'></tal:block>

Best,
--Shane Scott (Hackman238)
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/71537#71537]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...