I am trying to use the truncate filter on 2 variables (rsstitle and rssdescription), and assign the truncated version to a new variable (rsstitletrunc and rssdescriptiontrunc). I am relatively new to Template Toolkit, and dont understand why this code wont work (the SETs and IF/ELSE/END):
[% FOREACH feed IN rss_feeds %]
<div class="rssfeed">
<a class="rsstitle" href="[% feed.link | html %]">[% feed.title %]</a>
<div class="rssdescription">[% feed.description %]</div>
[% SET rsstitle = feed.title %]
[% SET rsstitleclean = rsstitle | truncate(10) %]
[% SET rssdescription = feed.description %]
[% SET rssdescriptionclean = rssdescription | truncate(10) %]
[% IF rssdescriptionclean == rsstitleclean %]
<div class="rssdescription">Same: [% rsstitleclean %] | [% rssdescriptionclean %]</div>
[% ELSE %]
<div class="rssdescription">Differs: [% rsstitleclean %] | [% rssdescriptionclean %]</div>
[% END %]
</div>
[% END %]
rsstitleclean returns the value of rsstitle (not truncated). rssdescriptionclean returns the value of rssdescription (not truncated). It seems I cant use filters on variables and declare the filtered value to another variable. Or can I?