Добрый день, помогите разобраться в ситуации, цель вывести меню статей в главное меню, это задача у меня получилось с помощью google, но не получилось чтоб при нажатие на меню, пункт оставался активным.
Код
catalog/view/theme/default/template/common/header.tpl
<div id="menu">
<ul>
<?php foreach ($informations as $information) { ?>
<li><?php if ($information['active']) { ?>
<a href="<?php echo $information['href']; ?>" class="active"><?php echo $information['title']; ?></a>
<?php } else { ?>
<a href="<?php echo $information['href']; ?>"><?php echo $information['title']; ?></a>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
catalog/controller/common/header.php
if (isset($this->request->get['path'])) {
$parts = explode('_', (string)$this->request->get['path']);
} else {
$parts = array();
}
$this->load->model('catalog/information');
$this->data['informations'] = array();
foreach ($this->model_catalog_information->getInformations(0) as $result) {
$this->data['informations'][] = array(
'title' => $result['title'],
'href' => $this->url->link('information/information', 'information_id=' . $result['information_id']),
'active' => in_array($result['information_id'], $parts)
);
}
Если нужны разъяснения сразу отпишусь