Hi Everyone,
I have created a child theme and currently trying to override a template file. I was reading through smarty template’s way of using variable modifiers and wanted to add custom styling to one part of my template. I’m trying to truncate the text of the $description variable using the variable modifier “truncate”. Unfortunately the text is not truncated even after adding the modifier. Is it better practice to be styling it with .less instead? Thank you for reading and your help!
indexSite.tpl file
{**
{if $about}
<div class="about_site">
{$about|nl2br}
</div>
{/if}
<div class="journals">
<div class="page-header">
<h2>
{translate key="journal.journals"}
</h2>
</div>
{if !count($journals)}
<div class="no_journals">
{translate key="site.noJournals"}
</div>
{else}
<ul class="media-list">
{iterate from=journals item=journal}
{capture assign="url"}{url journal=$journal->getPath()}{/capture}
{assign var="thumb" value=$journal->getLocalizedSetting('journalThumbnail')}
{assign var="description" value=$journal->getLocalizedDescription()}
<li class="media">
{if $thumb}
<div class="media-left">
<a href="{$url|escape}">
<img class="media-object" src="{$journalFilesPath}{$journal->getId()}/{$thumb.uploadName|escape:"url"}"{if $thumb.altText} alt="{$thumb.altText|escape}"{/if}>
</a>
</div>
{/if}
<div class="media-body">
<h3 class="media-heading">
<a href="{$url|escape}" rel="bookmark">
{$journal->getLocalizedName()}
</a>
</h3>
{if $description}
<div class="description">
TRYING TO MODIFY THIS >>>>>> {$description|strip_tags|nl2br|truncate:300:"..."}
</div>
{/if}
<ul class="nav nav-pills">
<li class="view">
<a href="{$url|escape}">
{translate key="site.journalView"}
</a>
</li>
<li class="current">
<a href="{url|escape journal=$journal->getPath() page="issue" op="current"}">
{translate key="site.journalCurrent"}
</a>
</li>
</ul>
</div>
</li>
{/iterate}
</ul>
{/if}
</div>