A
A
Ashur2017-07-02 20:57:04
1C-Bitrix
Ashur, 2017-07-02 20:57:04

Did I correctly output html at a certain time, and hide it at a certain time from the point of view of Bitrix?

at the moment I am doing this:

<? if(date(H) > 9 && date(H) < 19): ?>
                  <div class="main-phone-block">
                      <a href="tel:84952128506" class="phone">8 (495) 212-85-06</a>
                      <div class="shedule">время работы с 9-00 до 18-00</div>
                  </div>
              <? else: ?>
                  <div class="main-phone-block">
                      <a href="mailto:[email protected]" class="phone">[email protected]</a>
                      <div class="shedule">время работы с 9-00 до 18-00</div>
                  </div>
              <? endif; ?>

But is this correct from the point of view of Bitrix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2017-07-03
@babarun

If it works, then it's correct. But it can be improved.
Make a component, in the settings of which mail, phone, working time and interval will be transmitted.
(And if they are not set, then try to take from the default settings of Bitrix\Main\Config\Option )
Still in pursuit: it is better to store the values ​​​​( mail, phone, working hours and interval ) in the database (IB or HL, choose for yourself what you like best)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question