[Zope] DTML within DTML?

Jeff Peterson jpeterso@rangebroadband.com
Thu, 28 Mar 2002 13:59:32 -0600


Assuming record_id is in request namespace (also assuming it is a number)

Script(python)
===============

url = 'edit?r_id=%d' % (context.REQUEST.record_id)
context.REQUEST.RESPONSE.redirect(url)

you'll want to use full paths in the redirect, I know it works like that but
by rule it should be the full url.  So, then you'll want to use the same
method to add in the base url from REQUEST.BASE0 or whichever one is
required.

then in dtml do:

<dtml-call your_script>

if it is not in request pass it as a parameter.

<dtml-call "your_script(r_id=record_id)">

--
Jeffrey D. Peterson
Webmaster & Resident Standards Warrior
"The Trouble with doing anything right the first time is that nobody
appreciates how difficult it was."

> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Colin
> Fox
> Sent: Thursday, March 28, 2002 1:30 PM
> To: zope@zope.org
> Subject: [Zope] DTML within DTML?
>
>
>
> I'm trying to set up a dynamic redirect, and I can't figure out the
> syntax.
>
> Given there's a variable called 'record_id', and I have a page called
> 'edit' which takes a parameter called 'r_id', here's the redirect
> statement I'd like to use:
>
> <dtml-call expr="RESPONSE.redirect('edit?r_id=record_id')">
>
> I need the record_id field to be evaluated, but the rest to be used
> literally. How do I do this?
>
> THX.
>
> --
> Colin Fox                                       cfox@crystalcherry.com
> CF Consulting Inc.                                    GPG Fingerprint:
>                     D8F0 84E7 E7CC 5C6C 9982  F1A7 A3EB 6EA3 BC97 572F
>