On Friday 09 August 2002 11:08 am, Sir K wrote:
Hi,
<dtml-let article=absolute_url> <dtml-var article> </dtml-let> <a href="&dtml-absolute_url;"> more </a>
With the code above I was able to display absolute_url through var article, but I was unable to slice the var article to extract out the text i needed with this code.
<dtml-let article=absolute_url> <dtml-var expr="article[50:9]">
The python slicing syntax is: stringvar[start:end] If start > end then you always get an empty string (unless end is negative which means "from the right").
</dtml-let> <a href="&dtml-absolute_url;"> more </a>
I need somebody to please help me out of this problem.
What is it you are trying to slice out of the URL, the name of the parent or something? Quite frankly the concept you have presented scares me ;^) There is likely a better way that doesn't involve slicing the URL. Please let us know what you are trying to do (rather than just throw broken code at us) and maybe we can help you better. -Casey