SadBlackFox
Проверенные
- Сообщения
- 51
- Реакции
- 18
- Баллы
- 1,705
Сделал портал по офф мануалу:
Есть такой шаблон:
Вопрос: как обрезать текст на странице портала? Возможно ли обрезать не по кол-ву символов, а по абзацу?
Поиском нашёл только
У Вас недостаточно прав для просмотра ссылок.
Вход или Регистрация
Есть такой шаблон:
Код:
<xf:title>Portal</xf:title>
<xf:widgetpos id="portal_view_sidebar" position="sidebar" />
<xf:if is="$featuredThreads is not empty">
<xf:pagenav page="{$page}" perpage="{$perPage}" total="{$total}" link="portal" wrapperclass="block" />
<xf:foreach loop="$featuredThreads" value="$featuredThread">
<xf:macro name="thread_block"
arg-thread="{$featuredThread.Thread}"
arg-post="{$featuredThread.Thread.FirstPost}"
arg-featuredThread="{$featuredThread}"
/>
</xf:foreach>
<xf:pagenav page="{$page}" perpage="{$perPage}" total="{$total}" link="portal" wrapperclass="block" />
<xf:else />
<div class="blockMessage">No threads have been featured yet.</div>
</xf:if>
<xf:macro name="thread_block" arg-thread="!" arg-post="!" arg-featuredThread="!">
<xf:css src="message.less" />
<div class="block">
<div class="block-container" data-xf-init="lightbox">
<h4 class="block-header"><a href="{{ link('threads', $thread) }}">{$thread.title}</a></h4>
<div class="block-body">
<xf:macro name="message"
arg-post="{$post}"
arg-thread="{$thread}"
arg-featuredThread="{$featuredThread}"
/>
</div>
<div class="block-footer">
<a href="{{ link('threads', $thread) }}">Continue reading...</a>
</div>
</div>
</div>
</xf:macro>
<xf:macro name="message" arg-post="!" arg-thread="!" arg-featuredThread="!">
<div class="message message--post message--simple">
<div class="message-inner">
<div class="message-cell message-cell--main">
<div class="message-content js-messageContent">
<div class="message-attribution">
<div class="contentRow contentRow--alignMiddle">
<div class="contentRow-figure">
<xf:avatar user="{$post.User}" size="xxs" defaultname="{$post.username}" href="" />
</div>
<div class="contentRow-main contentRow-main--close">
<ul class="listInline listInline--bullet u-muted">
<li><xf:username user="{$thread.User}" /></li>
<li>
<xf:if is="$xf.options.PortalDefaultSort == 'featured_date'">
<xf:date time="{$featuredThread.featured_date}" />
<xf:else />
<xf:date time="{$thread.post_date}" />
</xf:if>
</li>
<li><a href="{{ link('forums', $thread.Forum) }}">{$thread.Forum.title}</a></li>
<li>{{ phrase('replies:') }} {$thread.reply_count|number}</li>
</ul>
</div>
</div>
</div>
<div class="message-userContent lbContainer js-lbContainer"
data-lb-id="post-{$post.post_id}"
data-lb-caption-desc="{{ $post.User ? $post.User.username : $post.username }} · {{ date_time($post.post_date) }}"
>
<blockquote class="message-body">
{{ bb_code($post.message, 'post', $post.User, {
'attachments': $post.attach_count ? $post.Attachments : [],
'viewAttachments': $thread.canViewAttachments()
}) }}
</blockquote>
</div>
</div>
</div>
</div>
</div>
</xf:macro>
Поиском нашёл только
{xen:string wordTrim, $value, 100}
, но что-то у меня не получается :(