[Zope] referencing an object elsewhere in the tree

sirius legend nu@goa.hu
Fri, 23 Nov 2001 20:19:20 -0800


flynt wrote:

>sirius legend wrote:
>
>>For example i build simple a shop, and have all shopping cart related
>>dtml methods in /cart folder. In the cart's list method i'd like to include
>>the icon, and other details can be found for example at
>>/products/accessories/wallet/. Is there any way to do this?
>>
>>Now I store string object id's in cart's session variables like
>>'/products/bags/djbag'. It's the cart item's original path.
>>I think I should be able to resolve the object from this id, but how?
>>
>
>Hi Martin
>
>Are you aware of the <dtml-with> tag ? With this tag you can put a
>certain folder on top of the namespace. For example:
>
><dtml-with "products.accessories.wallet">
>   *call methods located in the folder wallet*
></dtml-with>
>
>Regards
>
>--- Flynt
>

Nope =)
Here's my cart's list dtml method commented:

<dtml-if "FSSession.has_key( 'cart' )">
<ul>
  <dtml-in "FSSession['cart']" mapping>
    <li><dtml-var sequence-index>:
      <ul>
        <li>product id:<dtml-var pid>

Here i have the correct product id in pid :

"products.accessories.wallet"

But when i try

        <dtml-with pid>
          <dtml-var icon_1>
        </dtml-with>

this doesn't work, it looks for the icon in the cart folder.
 
       <li>quantity  :<dtml-var qnty>
        <li>selected material: <dtml-var selectedMaterial>
        <br>
        <a href = "/cart/edit?cid=<dtml-var sequence-index>">
          modify</a> |
        <a href = "/cart/delete?cid=<dtml-var sequence-index>">
          delete from cart</a><br>
      </ul>
    </li>
  </dtml-in>
</ul>
</dtml-if>

Where am i wrong?

10x,

 m