Новости Joomla

Вышел релиз Joomla 6.2

Релиз Joomla 6.2.0

Проект Joomla! рад сообщить о выходе новой минорной версии — Joomla 6.2 (кодовое имя Mwezi).

0 Пользователей и 1 Гость просматривают эту тему.
  • 4 Ответов
  • 1928 Просмотров
*

NetSkyer

  • Новичок
  • 4
  • 0 / 0
Схема шаблона сайта (index.php) следующая:
основной div = 100% внутри него:
слева идет div1=60%
по средине div2=20%
справа div3=20%
все они: display:block; float у всех left.

Как сделать, чтоб если в div2 ни один модуль не включен, то div2 не отображался вообще.
Т.е. если для определенной страницы не включен ни один модуль в поз.div2, то схема такая:
div1=80% div3=20%

Помоги пожалуйста решить?
*

Efanych

  • Глобальный модератор
  • 4683
  • 644 / 0
  • Меняю свою жизнь на 360°!
Создание сайтов, шаблонов, помощь в решении проблем.
*

GDV

  • Завсегдатай
  • 1898
  • 201 / 5
В шаблоне прописуем правила
Примерно такое
Код
if ($this->countModules("top_colum_3") && $this->countModules("top_colum_4") && $this->countModules("top_colum_5") && $this->countModules("top_colum_6")) { $top_row="30.8%"; }
else if (!$this->countModules("top_colum_3") && $this->countModules("top_colum_4") && $this->countModules("top_colum_5") && $this->countModules("top_colum_6")) { $top_row="30.8%"; }
else if ($this->countModules("top_colum_3") && !$this->countModules("top_colum_4") && $this->countModules("top_colum_5") && $this->countModules("top_colum_6")) { $top_row="30.8%"; }
else if ($this->countModules("top_colum_3") && $this->countModules("top_colum_4") && !$this->countModules("top_colum_5") && $this->countModules("top_colum_6")) { $top_row="30.8%"; }
else if ($this->countModules("top_colum_3") && $this->countModules("top_colum_4") && $this->countModules("top_colum_5") && !$this->countModules("top_colum_6")) { $top_row="30.8%"; }
else if (!$this->countModules("top_colum_3") && !$this->countModules("top_colum_4") && $this->countModules("top_colum_5") && $this->countModules("top_colum_6")) { $top_row="47.5%"; }
else if (!$this->countModules("top_colum_3") && $this->countModules("top_colum_4") && !$this->countModules("top_colum_5") && $this->countModules("top_colum_6")) { $top_row="47.5%"; }
else if (!$this->countModules("top_colum_3") && $this->countModules("top_colum_4") && $this->countModules("top_colum_5") && !$this->countModules("top_colum_6")) { $top_row="47.5%"; }
else if ($this->countModules("top_colum_3") && !$this->countModules("top_colum_4") && !$this->countModules("top_colum_5") && $this->countModules("top_colum_6")) { $top_row="47.5%"; }
else if ($this->countModules("top_colum_3") && !$this->countModules("top_colum_4") && $this->countModules("top_colum_5") && !$this->countModules("top_colum_6")) { $top_row="47.5%"; }
else if ($this->countModules("top_colum_3") && $this->countModules("top_colum_4") && !$this->countModules("top_colum_5") && !$this->countModules("top_colum_6")) { $top_row="47.5%"; }
else if (!$this->countModules("top_colum_3") && !$this->countModules("top_colum_4") && !$this->countModules("top_colum_5") && $this->countModules("top_colum_6")) { $top_row="100%"; }
else if (!$this->countModules("top_colum_3") && $this->countModules("top_colum_4") && !$this->countModules("top_colum_5") && !$this->countModules("top_colum_6")) { $top_row="100%"; }
else if (!$this->countModules("top_colum_3") && !$this->countModules("top_colum_4") && $this->countModules("top_colum_5") && !$this->countModules("top_colum_6")) { $top_row="100%"; }
else if ($this->countModules("top_colum_3") && !$this->countModules("top_colum_4") && !$this->countModules("top_colum_5") && !$this->countModules("top_colum_6")) { $top_row="100%"; }
Тут правда 4 колонки и разбивает равномерно, но смысл понятен. По быстрому взял с одного шаблона.
Убедительная просьба не писать в ЛС. Для решения Ваших проблем есть форум.
*

NetSkyer

  • Новичок
  • 4
  • 0 / 0
http://joomlaforum.ru/index.php/topic,67278.0.html
Помогло. Огромное спасибо!

GDV, Списибо, но оказывается можно проще. Я сделал так:

Код
<?php if($this->countModules('col_mcc2')) : ?>
    <div class="col1_y">
        <div class="col1"><jdoc:include type="modules" name="breadcrumb" /><jdoc:include type="component" /></div>
    </div>
    <div class="col2_y">
        <div class="col2"><jdoc:include type="modules" name="col_mcc2" style="xhtml" /></div>
    </div>
    <div class="col3_y">
        <div class="col3"><jdoc:include type="modules" name="col_mcc3" style="xhtml" /></div>
    </div>
<?php else: ?>
    <div class="col1_n">
        <div class="col1"><jdoc:include type="modules" name="breadcrumb" /><jdoc:include type="component" /></div>
    </div>
    <div class="col3_n">
        <div class="col3"><jdoc:include type="modules" name="col_mcc3" style="xhtml" /></div>
    </div>
<?php endif; ?>

Соответственно для .col1_y width: 60%, а для .col1_n width: 80%
*

GDV

  • Завсегдатай
  • 1898
  • 201 / 5
Не спорю. Просто под рукой как раз был этот index.php. И тупо скопировал с файла.
Рад что нашли способ по легче.
Убедительная просьба не писать в ЛС. Для решения Ваших проблем есть форум.
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Как оставить модуль слайдшоу вшитый в шаблон, только на главной странице ?

Автор akteon25

Ответов: 4
Просмотров: 7314
Последний ответ 13.05.2016, 13:25:23
от akteon25
Не отображается шаблон в Mozilla Firefox

Автор Sevenor

Ответов: 23
Просмотров: 5018
Последний ответ 10.04.2015, 13:36:30
от annushka
Шаблон > Позиция > Модуль

Автор vasilyreal

Ответов: 0
Просмотров: 1773
Последний ответ 22.02.2015, 21:19:48
от vasilyreal
На сайте тольк текст, не отображается шаблон сайта и админки

Автор jso

Ответов: 6
Просмотров: 4811
Последний ответ 14.09.2014, 08:17:08
от draff
В ссылке с index2.php отображается шаблон и модули, что за глюк?!

Автор hels

Ответов: 6
Просмотров: 2773
Последний ответ 05.07.2014, 22:03:16
от hels