Новости Joomla

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

sakha.rap

  • Осваиваюсь на форуме
  • 16
  • 0 / 0
Вот работаю над проектом удалил. В модуле Главное меню > показывать подпункты меню включен.
Может ли настройки шаблона на это повлиять. Вот код из teamplates/шаблон/html/mod_menu/default.php
Код
<?php
defined('_JEXEC') or die;

require_once dirname(dirname(dirname(__FILE__))). DIRECTORY_SEPARATOR . 'functions.php';

// Note: it is important to remove spaces between elements.

$tag = ($params->get('tag_id')!= NULL)? ' id="' . $params->get('tag_id'). '"' : '';
if (isset($attribs['name']) && $attribs['name'] == 'position-1') {
    $menutype = 'horizontal';

    $start = $params->get('startLevel');

    // check if it is necessary to render subitems:
    $subitems = $GLOBALS['artx_settings']['menu']['show_submenus'] && 1 == $params->get('showAllChildren');
    // true - skip the current node, false - render the current node.
    $skip = false;
   
    echo '<ul class="dd-hmenu' . $class_sfx . '"' . $tag . '>';
    foreach ($list as $i => & $item) {
        if ($skip) {
            if ($item->shallower) {
                if (($item->level - $item->level_diff) <= $limit) {
                    echo '</li>' . str_repeat('</ul></li>', $limit - $item->level + $item->level_diff);
                    $skip = false;
                }
            }
            continue;
        }

        $class = 'item-' . $item->id;
        $class .= $item->id == $active_id ? ' current' : '';
        $class .= ('alias' == $item->type
            && in_array($item->params->get('aliasoptions'), $path)
            || in_array($item->id, $path))? ' active' : '';
        $class .= $item->deeper ? ' deeper' : '';
        $class .= $item->parent ? ' parent' : '';

        echo '<li class="' . $class . '">';

        // Render the menu item.
        switch ($item->type) {
            case 'separator':
            case 'url':
            case 'component':
                require JModuleHelper::getLayoutPath('mod_menu', 'default_' . $item->type);
                break;
            default:
                require JModuleHelper::getLayoutPath('mod_menu', 'default_url');
                break;
        }
        if ($item->deeper) {
            if (!$subitems) {
                $limit = $item->level;
                $skip = true;
                continue;
            }
            echo '<ul>';
        }
        elseif ($item->shallower)
            echo '</li>' . str_repeat('</ul></li>', $item->level_diff);
        else
            echo '</li>';
    }
    echo '</ul>';
} else if (0 === strpos($params->get('moduleclass_sfx'), 'dd-vmenu') || false !== strpos($params->get('moduleclass_sfx'), ' dd-vmenu')) {
    $menutype = 'vertical';

    $start = $params->get('startLevel');

    // check if it is necessary to render subitems:
    $subitems = $GLOBALS['artx_settings']['vmenu']['show_submenus'] && 1 == $params->get('showAllChildren');
    // true - skip the current node, false - render the current node.
    $skip = false;
    // limit of rendering - skip items when a level is exceeding the limit.
    $limit = $start;

    echo '<ul class="dd-vmenu"' . $tag . '>';
    foreach ($list as $i => & $item) {
        if ($skip) {
            if ($item->shallower) {
                if (($item->level - $item->level_diff) <= $limit) {
                    echo '</li>' . str_repeat('</ul></li>', $limit - $item->level + $item->level_diff);
                    $skip = false;
                }
            }
            continue;
        }

        $class = 'item-' . $item->id;
        $class .= $item->id == $active_id ? ' current' : '';
        $class .= ('alias' == $item->type
            && in_array($item->params->get('aliasoptions'), $path)
            || in_array($item->id, $path))? ' active' : '';
        $class .= $item->deeper ? ' deeper' : '';
        $class .= $item->parent ? ' parent' : '';

        echo '<li class="' . $class . '">';

        // Render the menu item.
        switch ($item->type) {
            case 'separator':
            case 'url':
            case 'component':
                require JModuleHelper::getLayoutPath('mod_menu', 'default_' . $item->type);
                break;
            default:
                require JModuleHelper::getLayoutPath('mod_menu', 'default_url');
                break;
        }
        if ($item->deeper) {
            if (!$subitems) {
                $limit = $item->level;
                $skip = true;
                continue;
            }
            echo '<ul' . ($subitems && (in_array($item->id, $path) || 'alias' == $item->type
                && in_array($item->params->get('aliasoptions'), $path))? ' class="active"' : ''). '>';
        }
        elseif ($item->shallower)
            echo '</li>' . str_repeat('</ul></li>', $item->level_diff);
        else
            echo '</li>';
    }
    echo '</ul>';
} else {
    $menutype = 'default';
    echo '<ul class="menu' . $params->get('class_sfx'). '"' . $tag . '>';
    foreach ($list as $i => &$item) {

        $class = 'item-' . $item->id;
        $class .= $item->id == $active_id ? ' current' : '';
        $class .= ('alias' == $item->type
            && in_array($item->params->get('aliasoptions'), $path)
            || in_array($item->id, $path))? ' active' : '';
        $class .= $item->deeper ? ' deeper' : '';
        $class .= $item->parent ? ' parent' : '';

        echo '<li class="' . $class . '">';

        // Render the menu item.
        switch ($item->type) {
            case 'separator':
            case 'url':
            case 'component':
                require JModuleHelper::getLayoutPath('mod_menu', 'default_'.$item->type);
                break;
            default:
                require JModuleHelper::getLayoutPath('mod_menu', 'default_url');
                break;
        }

        if ($item->deeper)
            echo '<ul>';
        elseif ($item->shallower)
            echo '</li>' . str_repeat('</ul></li>', $item->level_diff);
        else
            echo '</li>';
    }
    echo '</ul>';
}
teamplates/шаблон/html/mod_menu/default_component.php
Код
<?php
defined('_JEXEC') or die;

// Note: it is important to remove spaces between elements.
$attributes = array(
    'class' => array($item->params->get('menu-anchor_css', '')),
    'title' => $item->params->get('menu-anchor_title', ''));
switch ($item->browserNav) {
    default:
    case 0:
        $attributes['href'] = $item->flink;
        break;
    case 1:
        // _blank
        $attributes['href'] = $item->flink;
        $attributes['target'] = '_blank';
        break;
    case 2:
        // window.open
        $attributes['href'] = $item->flink;
        $attributes['onclick'] = 'window.open(this.href,\'targetWindow\','
            . '\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes\');return false;';
        break;
}

$linktype = $item->menu_image
    ? ('<img class="dd-menu-image" src="' . $item->menu_image . '" alt="' . $item->title . '" />'
        . ($item->params->get('menu_text', 1) ? $item->title : ''))
    : $item->title;

if (('horizontal' == $menutype || 'vertical' == $menutype)
    && ('alias' == $item->type && in_array($item->params->get('aliasoptions'), $path) || in_array($item->id, $path)))
{
    $attributes['class'][] = 'active';
}

echo artxTagBuilder('a', $attributes, $linktype);
teamplates/шаблон/html/mod_menu/default_separator.php
Код
<?php
defined('_JEXEC') or die;

// Note: it is important to remove spaces between elements.
$attributes = array('class' => array(),
    'title' => $item->params->get('menu-anchor_title', ''));

$linktype = $item->menu_image
    ? ('<img class="dd-menu-image" src="' . $item->menu_image . '" alt="' . $item->title . '" />'
        . ($item->params->get('menu_text', 1) ? $item->title : ''))
    : $item->title;

if ('default' == $menutype) {
    echo '<span class="separator">' . $linktype . '</span>';
} else if ('horizontal' == $menutype || 'vertical' == $menutype) {
    if ('alias' == $item->type && in_array($item->params->get('aliasoptions'), $path) || in_array($item->id, $path))
        $attributes['class'][] = 'active';
    $attributes['class'][] = $item->deeper ? 'separator' : 'separator-without-submenu';
    echo artxTagBuilder('a', $attributes, $linktype);
}

teamplates/шаблон/html/mod_menu/default_url.php
Код
<?php
defined('_JEXEC') or die;

jimport('joomla.filter.output');

$attributes = array(
    'class' => array($item->anchor_css),
    'title' => $item->anchor_title,
    'href' => JFilterOutput::ampReplace(htmlspecialchars($item->flink)));

switch ($item->browserNav) {
    case 1:
        // _blank
        $attributes['target'] = '_blank';
        break;
    case 2:
        // window.open
        $attributes['onclick'] = 'window.open(this.href,\'targetWindow\','
            . '\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes\');return false;';
        break;
}

$linktype = $item->menu_image
    ? ('<img class="dd-menu-image" src="' . $item->menu_image . '" alt="' . $item->title . '" />'
        . ($item->params->get('menu_text', 1) ? $item->title : ''))
    : $item->title;

if (('horizontal' == $menutype || 'vertical' == $menutype)
    && ('alias' == $item->type && in_array($item->params->get('aliasoptions'), $path) || in_array($item->id, $path)))
{
    $attributes['class'][] = 'active';
}

echo artxTagBuilder('a', $attributes, $linktype);
« Последнее редактирование: 11.03.2019, 16:42:41 от sakha.rap »
*

sivers

  • Живу я здесь
  • 2465
  • 336 / 0
А подпункты в главном меню точно созданы?
На связи в telegram @sivers
sivers @ inbox . ru
https://sivers.su/
*

sakha.rap

  • Осваиваюсь на форуме
  • 16
  • 0 / 0
Запутался, создал. Я только учусь в Joomla, в вебмастеринге только две недели шарусь=) 
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Один пункт меню думает что он главный

Автор DamaVbubi

Ответов: 4
Просмотров: 330
Последний ответ 13.02.2024, 19:49:10
от DamaVbubi
[Решено] Перестали работать переходы по меню сайта

Автор AlexP750

Ответов: 12
Просмотров: 545
Последний ответ 06.02.2024, 12:42:26
от AlexP750
Пропало главное меню, и контент на главной (после обновления)

Автор GTHack

Ответов: 15
Просмотров: 546
Последний ответ 07.01.2024, 16:00:15
от ProtectYourSite
Автоматическая снятие с публикации пункта меню

Автор all_zer

Ответов: 2
Просмотров: 344
Последний ответ 30.12.2023, 15:29:58
от all_zer
Как сделать отображение времени создания материала?

Автор Pzhigalov

Ответов: 0
Просмотров: 329
Последний ответ 27.09.2023, 22:45:29
от Pzhigalov