A
A
aby1252020-03-06 12:42:19
1C-Bitrix
aby125, 2020-03-06 12:42:19

How do you determine which part of the layout to put in header.php if there are many small differences in the header?

How do you determine which part of the layout to put in header.php if there are many small differences in the header?
Moreover, it is not radically different, but many different classes appear there or change. Sometimes additional tags appear, which, among other things, need to be closed in the footer. If you make conditions for the url, then there will be a large footcloth.
So far, I have come to such an option that I will use deferred functions. I will choose a certain layout standard for the header, which is for ordinary simple pages. I’ll write it into a variable and, through a deferred function, I’ll display it in the right places in the header and footer. And then I will change the components, if necessary. But for some reason, I did not see such an approach in the lessons and courses on Bitrix.
For example, here is a tag that changes frequently in this header layout:

<div class="page__inner page__inner--base">
<div class="page__inner page__inner--basehalf-bg">
<div class="page__inner page__inner--baseproject intro-effect-push">
<div class="page__inner page__inner--baseindex">

Moreover, on some one option, on others the second, on a few more the third, and on the main one the fourth. And there are a lot of such trifles where one class in the header changes, sometimes new tags (divas) are added, but this is rare.

Share your experience, how do you solve such problems and did I choose the right solution?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander, 2020-03-06
@aby125

If you make conditions on the url
it will not be just a big footcloth, but in hell you will be boiled in the hottest cauldron.
So far I have come to such an option that I will use deferred functions

I did everything correctly - let the page itself manage the template above itself, if it is impossible to avoid such a layout as you describe.
Moreover, on some one option, on others the second, on a few more the third, and on the main one the fourth. And there are a lot of such trifles where one class in the header changes, sometimes new tags (divas) are added, but this is rare.

In general, it is better to avoid such situations, and if necessary, make differences in the appearance, manage them through css + classes on the body like .page-main, .page-inner, .page-blog (dashes and underlines can be arranged depending on the type of disorder in layout designer) and so on, but hang these classes through deferred functions.

V
Viktor Taran, 2020-03-06
@shambler81

redo the interface design.
Your TK speaks of an ill-conceived interface and it's not in the assembly.
In usability there is a concept "interface expectation"
In your case it does not smell
Therefore usability of such creation will be awful.

M
Mikhail, 2020-03-06
@RuComMarket

I would fire such a workbench
, the project requires a complete rework, there are some nuances in Bitrix that must be observed when layout, throwing a huge number of classes with such distributions leads first of all to an increase in development time, secondly to a large amount of processed and transmitted data, thirdly already on sale when changing content, there will be a lot of garbage

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question