Новости Joomla

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

Rockfire

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Имеем файл index.php шаблона с таким кодом

Код
// Use the folowing option for quick off LEFT and LIRHT positions displaying
$sideBarsScheme = array (
// By default
'default'=>      'left-content-right',

// Specify extra options for different components
// If you dont write left or right - these positions wont be published
// left-right-content | right-left-content | content-right-left | content-left-right
// left-content-right | right-content-left
// right-content | content-left | left-content | content-right
'com_wrapper'=>  'content',
'com_fireboard'=>  'content',
'com_content'=>    'left-content-right',
'com_frontpage' => 'left-content',

И такой кусок

Код
/***
DO NOT MODIFY THIS IF YOU DONT KNOW WHAT YOU DOING!
***/
if ($option && isset($sideBarsScheme[$option]) && trim($sideBarsScheme[$option]) && stristr($sideBarsScheme[$option],'content')!= false){
$currentScheme = trim($sideBarsScheme[$option]);

} else {
$currentScheme = $sideBarsScheme['default'];
}
if (!$this->countModules('left')) $currentScheme = str_replace('left','',$currentScheme);
if (!$this->countModules('right')) $currentScheme = str_replace('right','',$currentScheme);

$schemeOutput = '';
$currentScheme = explode("-",$currentScheme);

if (is_array ($currentScheme)) {
   foreach ($currentScheme as $item) {
       if ($item) $schemeOutput[] = $item;
   }
}
$currentScheme = "scheme_".count($schemeOutput);


В итоге
Код
<body class="<?php echo $currentScheme ?>

У меня отображается сейчас
Код
<body class="scheme_3"
И на главной, и на внутренних

Сайт
http://splitstream.ru

Как видно из CSS, scheme_3 - задает ширину контента, да и вообще много других параметров.

При выводе, как настроить схему по разному для главной страницы или внутренних или для разных разделов вообще?
То есть поменять схему?
*

Rockfire

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Если меняю
Код
'com_content'=>    'left-content-right',
на
Код
'com_content'=>    'left-content',


То все срабатывает,
а если меняю
Код
'com_frontpage' => 'left-content',
то нет,

Может потому, что главная задана в меню, как
index.php?option=com_content&view=frontpage

?
*

Rockfire

  • Осваиваюсь на форуме
  • 12
  • 0 / 0
Такое ощущение, что шаблон под Joomla 1.0, так как:

But in Joomla! 1.5.x the com_frontpage component is no longer present. This is how to achieve the same result in Joomla! 1.5.x
Код
<?php
$menu = & JSite::getMenu();
if ($menu->getActive() == $menu->getDefault()) {
echo 'This is the front page';
}
?>
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться