ZPT : prevent unauthorized error
<img src="icon" tal:attributes="src item1/icon; alt item1/title_or_id"> Produce the following Error Type: Undefined Error Value: "You are not authorized to access icon." not found in "item1/icon" How could I prevent this happen? Or to provide an default icon instead? In a more general case, how could I prevent unauthorized error in ZPT? Rgs Kent Sin __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
kent sin wrote:
Error Type: Undefined Error Value: "You are not authorized to access icon." not found in "item1/icon"
How could I prevent this happen? Or to provide an default icon instead?
Whenever you use a path that may fail, you can provide a fallback path using the "|" operator. The most common fallback paths are "default" and "nothing", but you can use any path. For example: Default (leave src value alone): <img src="/images/default_icon" tal:attributes="item1/icon | default"> Dynamic fallback: <img src="icon" tal:attributes="item1/icon | here/default_icon"> Cheers, Evan @ 4-am & Zope
participants (2)
-
Evan Simpson -
kent sin