Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Matteo Russo Posted May 24, 2020 Posted May 24, 2020 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 🙂
opentype Posted May 24, 2020 Posted May 24, 2020 3 minutes ago, Matteo Russo said: {$record->_title} Is that already wrapped with anything in the template? Like a headline or something? It needs some kind of wrapper to work. DIV, H3, P … <h3 class="ipsTruncate ipsTruncate_line">{$record->_title}</h3> Hisashi 1
Matteo Russo Posted May 24, 2020 Author Posted May 24, 2020 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. 🙂
Meddysong Posted May 24, 2020 Posted May 24, 2020 Pit it in the h2 tag at the beginning 🙂 Matteo Russo 1
Matteo Russo Posted May 25, 2020 Author Posted May 25, 2020 15 hours ago, Meddysong said: Pit it in the h2 tag at the beginning 🙂 Worked! Many thanks 🙂 Meddysong 1
Recommended Posts