Created
February 25, 2014 10:58
-
-
Save smolnikov/9206864 to your computer and use it in GitHub Desktop.
Twig-шаблон компонента bitrix:news.list для вывода новостей (см. http://marketplace.1c-bitrix.ru/solutions/htc.twigintegrationmodule/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach ($arResult["ITEMS"] as $key => $value) { | |
$userId = $value["PROPERTIES"]["AUTHOR_ID"]["VALUE"]; | |
$userSelection = CUser::GetByID($userId); | |
$userData = $userSelection->Fetch(); | |
$fullName = $userData["NAME"] . " " . $userData["LAST_NAME"]; | |
$arResult["ITEMS"][$key]["FULL_NAME"] = $fullName; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if result.ITEMS is not empty %} | |
<div class="page-content-box page-content-box__comment-list-wrapper"> | |
<h2 class="page-content-box-head" id="comments-count-title"> | |
{% set commentsCount = result.ITEMS|length %} | |
{{ commentsCount }} {{ langMessages["COMMENTS_STRING"]|russianPluralForm(commentsCount) }} | |
</h2> | |
<div class="page-content-box-body"> | |
<ul class="comment-list"> | |
{% for item in result.ITEMS %} | |
<li class="comment-elem" data-id="{{ item.ID }}"> | |
<div class="comment-user-name"> | |
<span class="icon icon__user"></span> | |
{{ item.FULL_NAME }} | |
<div class="comment-date">{{ item.ACTIVE_FROM | formatLocalizedDate('FULL_CONDITIONAL') }}, {{ item.ACTIVE_FROM | formatLocalizedDate('TIME') }}</div> | |
</div> | |
<div class="comment-user-wrapper"> | |
<p class="comment-user-p"> | |
{{ item.DETAIL_TEXT }} | |
</p> | |
</div> | |
</li> | |
{% endfor %} | |
</ul> | |
</div> | |
</div> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment