Robin Smidsrød wrote:
My first initial reaction was to try and remove the inner tags, add a terminating single quote and use a string concatenation character to include the output of the embed() function directly into the string. I researched the mailinglist, but found no string concatenation character in TT. Only some references to "." or "~" that didn't work.
I can help you out on that part: http://www.template-toolkit.org/docs/plain/Manual/Directives.html#Accessing_and_Updating_Template_Variables "You can concatenate strings together using the ' _ ' operator. In Perl 5, the '.' is used for string concatenation, but in Perl 6, as in the Template Toolkit, the '.' will be used as the method calling operator and ' _ ' will be used for string concatenation. Note that the operator must be specified with surrounding whitespace which, as Larry says, is construed as a feature:" String concat doesn't work inside parenths, though. ie: abc('test' _ 'abc'). So the way you suggested is the only way to really do it in that case. For your other problems: If you don't have many places to fix, I'd just use a regexp to find all the occurrences of these tags and then you can keep replacing them. Patterns that are used over and over you can do a search and replace on using a regexp, saving yourself lots of time. (You could also output the changes and require that you input "Y" for each one.) -- Josh _______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates
