Is there a syntax I can use to include another folder in my namespace, when I wont know which folder until runtime? For example, if I have similarly-named preferences for different customers in folders CUST1 and CUST2, I would like to at run-time be able to do something similar to: <dtml-with "CurrentCustomerString"> to get the correct customer folder in my namespace. Thanks in advance for any suggestions.
Hello Roger, Monday, November 11, 2002, 8:46:22 PM, you wrote: RF> Is there a syntax I can use to include another folder in my namespace, when RF> I wont know which folder until runtime? .. RF> something similar to: RF> <dtml-with "CurrentCustomerString"> RF> to get the correct customer folder in my namespace. ehm.. it has been at least a year now with no DTML, but i seem to recall that something like this should work..: <dtml-with "_[CurrentCustomerString]"> if CurrentCustomerString is a string equal to the id of the folder you want to include... hope it works :) -- Geir Bækholt geir@funcom.com Tools/HCI-developer Tools/Billing - Product Operations Funcom Oslo
Hi, --On Montag, 11. November 2002 11:46 -0800 Roger Fisher <rlfisher@sprynet.com> wrote:
Is there a syntax I can use to include another folder in my namespace, when I wont know which folder until runtime?
For example, if I have similarly-named preferences for different customers in folders CUST1 and CUST2, I would like to at run-time be able to do something similar to: <dtml-with "CurrentCustomerString"> to get the correct customer folder in my namespace.
This would be <dtml-with expr="_[CurrentCustomerString]">. You should really try to drop DTML and go to Python Script. Regards Tino
Roger Fisher writes:
Is there a syntax I can use to include another folder in my namespace, when I wont know which folder until runtime?
For example, if I have similarly-named preferences for different customers in folders CUST1 and CUST2, I would like to at run-time be able to do something similar to: <dtml-with "CurrentCustomerString"> to get the correct customer folder in my namespace. You do it for "dtml-with" the same way you do it for "dtml-var".
<dtml-with "_.getitem(CurrentCustomerString)"> ... </dtml-with> When you use "_[CurrentCustomerString]", you have a good chance that it will not work (it will not, whenever the object is callable). Dieter
participants (4)
-
Dieter Maurer -
Geir Bækholt -
Roger Fisher -
Tino Wildenhain