Hello, I'm new to zope, and find it the best web application environment ;) Have a little problem... Browsed thru the docs and mailing lists, but can't find any information on how can i refer to objects that are not in the acquistion path. 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? There are also relations between products, like a products can be made from a list of materials, and that materials are also products. I tried to use ZCatalog to solve this, but it indexed only the current folder ( eg. /products/bags, but not the /products/materials ). The layout: /products/ materials/ natural1/ icon.gif, etc... natural2/ coloured/ black/ orange/ ... bags/ djbag/ ( here i'd like to have a manually edited list of links to materials ) backpack/ ... /cart/ list ( here i'd like to resolve object ids like /products/bags/dj ) edit ... Your help would be appreciated, martin
sirius legend wrote:
Hello,
I'm new to zope, and find it the best web application environment ;)
Have a little problem... Browsed thru the docs and mailing lists, but can't find any information on how can i refer to objects that are not in the acquistion path.
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?
There are also relations between products, like a products can be made from a list of materials, and that materials are also products. I tried to use ZCatalog to solve this, but it indexed only the current folder ( eg. /products/bags, but not the /products/materials ).
The layout:
/products/ materials/ natural1/ icon.gif, etc... natural2/ coloured/ black/ orange/ ...
bags/ djbag/ ( here i'd like to have a manually edited list of links to materials ) backpack/ ...
/cart/ list ( here i'd like to resolve object ids like /products/bags/dj ) edit ...
Your help would be appreciated,
martin
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
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
participants (2)
-
flynt -
sirius legend