If I have a namespace which contains a namespace called images while it's parent also contains a namespace called images how do I make the following section of code access the correct namespace? I know where my obvious problem is, when calling parent_meth from child_meth the parent_meth dtml-with images is returning the child images object which does not contain default.gif inside of it's namespace and therefore gives me an exception. The question is what other options do I have? in namespace like: <parent> |_parent_meth (dtml_method) |_<images> | |_default.gif |_<child> |_child_meth (dtml_method) |_<images> |_example.gif ****in child_meth**** <dtml-let image="'example.gif'"> <dtml-var parent_meth> </dtml-let> <dtml-var parent_meth> ****in parent_meth**** <dtml-if image> <dtml-with images> <dtml-var images[image]> </dtml-with> <dtml-else> <dtml-let image="'default.gif'"> <dtml-with images> <dtml-var images[image]> </dtml-with> </dtml-let> </dtml-if>
Matt Gregory writes:
If I have a namespace which contains a namespace called images while it's parent also contains a namespace called images how do I make the following section of code access the correct namespace? I know where my obvious problem is, when calling parent_meth from child_meth the parent_meth dtml-with images is returning the child images object which does not contain default.gif inside of it's namespace and therefore gives me an exception. When you know from which "images" your specific image should come, you can use
<dtml-with expr="parent_of_images.images"><dtml-var your_specific_image></dtml-with> Dieter
participants (2)
-
Dieter Maurer -
Matt Gregory