Search code examples
smartycs-cart

smarty cs-cart assign a link to a variable


I am learning smarty. I want to assign a link to a variable:

{assign var="book_link" value="`$smarty.capture.$name` nofilter"}

I want to use truncate to produce that book_link, so i use

<div class="title-book">{$book_link|truncate:50}</div>

But it did not work.


Solution

  • just change the double quotes from value and try this

    {assign var="book_link" value=`$smarty.capture.$name` nofilter}