[[+content_image]]
A
A
Alexander Ivanov2016-03-01 18:07:26
1C-Bitrix
Alexander Ivanov, 2016-03-01 18:07:26

Can I set my own template in Bitrix news and other components?

Many CMS sin with their layout, and the inability to change it.
MODX revo is not one of those. In it, you can set your own template for any component.
For example, chl.crumbs:

[[pdoCrumbs?
&tpl=`@INLINE <li><a href="[[+link]]#catalog">[[+menutitle]]</a></li>` // template link
&tplCurrent=`@INLINE <li class="active">[[+menutitle]]</li>` //template current
&tplWrapper=`@INLINE <ol class="breadcrumb">[[+output]]</ol>` //template wrapper
&outputSeparator=`` //razdelitel
&showHome=`1` //def="0" show home page
]]

Can I somehow set my own template for the bitrix:NEWS component and others?
For example somewhere here:
<?$APPLICATION->IncludeComponent(
          "bitrix:news.list",
          "",
          Array(
            "CACHE_TYPE" => "N",
            "DISPLAY_DATE" => "N",
            "DISPLAY_TOP_PAGER" => "N",
            "DISPLAY_BOTTOM_PAGER" => "N",
            "GLOBAL_ACTIVE" => "N",
            "IBLOCK_ID" => "[id]",
            "IBLOCK_TYPE" => "news",
            "AJAX_OPTION_STYLE" => "N",
            "NEWS_COUNT" => "6",
            "PROPERTY_CODE" => Array("DESCRIPTION"),
            "PAGER_DESC_NUMBERING" => "N",
            "SORT_BY1" => "RAND",
            "SORT_ORDER1" => "RAND",
            "SORT_BY2" => "RAND",
            "SORT_ORDER2" => "RAND",
"tpl" => "путь для файла, в котором мой PHP код"
          )
        );
        ?>

- Why is it necessary?
- So that the output is my version, not Bitrix.

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
Alexey Ukolov, 2016-03-01
@cimonlebedev

Of course it is possible. But I will send you to official courses for details , there is no point in retelling them.

S
Sergey, 2016-03-01
@Logic87

For quick mastering the practice of customizing component templates, look for video tutorials. There are many of them on the web.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question