[ZPT] forcing a string to be a path

Fernando Martins fernando at cmartins.demon.nl
Sat May 1 05:06:32 EDT 2004


Hi Adam,

> I am attempting to include different content based on a variable in the
> url, fish?content=trout.  In my template doing something like:
>
> <span tal:replace="structure request/content">content goes here</span>
>
> ends up replacing the tag with the string "trout" instead of the
> contents of the file named trout.

Which is correct and as expected. If I call your name, Adam, I'll get to see
your face but if I want your money in the bank I've to ask bank/adam :-). Of
course, if I want to reach a variety of people, I've to do bank/?person or
in your code sample:

<span tal:define="fish request/content" tal:replace="structure
here/?fish">content goes here</span>

See also http://zope.org/Wikis/DevSite/Projects/ZPT/VariablesInPaths

HTH,
Fernando




More information about the ZPT mailing list