Jump to content

[Pages] Truncate record title


Matteo Russo

Recommended Posts

Hello guys,

I created a new custom block and I need to truncate the record title becasue it's too long. I noticed that for truncating the content it works like that: 

Quote

<section class='ipsType_normal ipsType_richText ipsType_break' data-ipsTruncate data-ipsTruncate-size='3 lines' data-ipsTruncate-type='remove'>
            {$record->truncated()|raw}
</section>

The title tho I have this code {$record->_title} and I don't know whic variant should I use. Anyone can help me? Thanks 🙂 

Link to comment
Share on other sites

Quote

<h2 class='record-title ipsType_pageTitle'>
            {{if $record->hidden() === -1 || $record->hidden() === 1}}
                {{if $record->hidden() === -1}}
                    <span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$record->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span>
                {{elseif $record->hidden() === 1}}
                    <span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span>
                {{endif}}
            {{endif}}
            <a href="{$record->url()}" title="{lang="read_more_about" sprintf="$record->_title"}">
                {{if $record->unread()}}
                    <span class='ipsItemStatus' data-ipsTooltip title="{lang="cms_unread_record"}"><i class="fa fa-circle"></i></span>
                {{endif}}
                {$record->_title}
            </a>
        </h2>

That's the full code. 🙂 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...