C
C
choodo2017-03-29 11:51:39
PHP
choodo, 2017-03-29 11:51:39

How to correctly place components in a Bitrix template?

How correctly (or what is the principle) to place components in the Bitrix template?
Example: I remake the existing html layout template into a Bitrix template. Divided everything into header.php and footer.php. Now you need to place a banner-slider on the main page and, for example, bestsellers. How it's done?
Do I need to check the place of the call in header.php and, based on this, connect the banner? So? (for example, this index.php is called on the main page, therefore, we include a banner here)
Or is it done in some other way?
And if so, then it turns out that all the output control logic is placed by conditions (if-else) in header.php and footer.php?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danbka, 2017-03-29
@Danbka

In header and footer it is better to do without if-s. Better to do:
1) Different templates for different pages (for example, one for the main page, another for the internal ones)
2) Use include areas.

N
Nikita, 2017-05-25
@Rema1ns

in your case, in the header and footer of the site template, keep only the header and footer of the site, and simply put the slider on the main page in the index, just like a bestseller.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question