yastranger Posted March 22, 2012 Report Share Posted March 22, 2012 Как поставить ? Что прописать в шаблоне для её вызова? Изучаю систему, инфы тут и на оф блоге про навигационную крошку не нашел. Quote Link to post Share on other sites
filth Posted March 22, 2012 Report Share Posted March 22, 2012 products.tpl<!-- Хлебные крошки /--><div id="path"> <a href="/">Главная</a> {if $category} {foreach from=$category->path item=cat} ? <a href="catalog/{$cat->url}">{$cat->name|escape}</a> {/foreach} {if $brand} ? <a href="catalog/{$cat->url}/{$brand->url}">{$brand->name|escape}</a> {/if} {elseif $brand} ? <a href="brands/{$brand->url}">{$brand->name|escape}</a> {elseif $keyword} ? Поиск {/if}</div><!-- Хлебные крошки #End /--> Quote Link to post Share on other sites
igoryk Posted March 22, 2012 Report Share Posted March 22, 2012 а нет ли решения универсального для всех страниц? вписал код в index.tpl ? и не паришся с остальными страницами ? Quote Link to post Share on other sites
filth Posted March 22, 2012 Report Share Posted March 22, 2012 попробуй))) Quote Link to post Share on other sites
filth Posted March 22, 2012 Report Share Posted March 22, 2012 а вообще смысл? Quote Link to post Share on other sites
igoryk Posted March 22, 2012 Report Share Posted March 22, 2012 смысл - есть некоторые вопросы к верстке - например - я бы вывод "крошек" поднял-бы, чего при данном исполнении - сделать нельзя, т.к. Этот блок находится вне страниц отличных от index ... Quote Link to post Share on other sites
filth Posted March 22, 2012 Report Share Posted March 22, 2012 если вставить в index.tpl, то путь будет выводиться, но этот код написан только для категорий, брендов и поиска. т.е. он будет отображать пути только этих классов. Для остального допилить нужно. Quote Link to post Share on other sites
Kosjak76 Posted March 22, 2012 Report Share Posted March 22, 2012 Для чего остального? Для страниц?Для товаров есть... Quote Link to post Share on other sites
igoryk Posted March 22, 2012 Report Share Posted March 22, 2012 Да для страниц, и блога Quote Link to post Share on other sites
yastranger Posted March 23, 2012 Author Report Share Posted March 23, 2012 filth Спасибо все заработало!!!!)))) Quote Link to post Share on other sites
filth Posted March 27, 2012 Report Share Posted March 27, 2012 Вот допилил. Значит в index.tpl в нужном месте:<!-- Хлебные крошки /--> <div id="path"> {if $category} <a href="/">Главная</a> {foreach from=$category->path item=cat} ? <a href="catalog/{$cat->url}">{$cat->name|escape}</a> {/foreach} {if $brand} ? <a href="catalog/{$cat->url}/{$brand->url}">{$brand->name|escape}</a> {/if} {if $product} ? {$product->name|escape} {/if} {elseif $brand} ? <a href="brands/{$brand->url}">{$brand->name|escape}</a> {elseif $keyword} <a href=\"/\">Главная</a> ? Поиск {/if} </div> <!-- Хлебные крошки #End /-->Что нового: на главной цепочки не видно! путь показывается до товара включительно. На другие страницы не делал, так как мне всё же бессмысленным кажеться. Quote Link to post Share on other sites
igoryk Posted March 27, 2012 Report Share Posted March 27, 2012 Замечательно, но как сюда же добавить все остальное - блог, страницы, и.т.д. ? Quote Link to post Share on other sites
filth Posted March 28, 2012 Report Share Posted March 28, 2012 ну если оч. нужно то просто: перед последним {/if} вставляем{elseif $page}<a href="/">Главная</a>? {$page->name|escape} Quote Link to post Share on other sites
igoryk Posted March 29, 2012 Report Share Posted March 29, 2012 Да - заработало - но как теперь убрать - (Главная ? Главная ) с главной страницы - а то как то не красиво... Quote Link to post Share on other sites
filth Posted March 29, 2012 Report Share Posted March 29, 2012 А вот это Я побороть не сумел))) Quote Link to post Share on other sites
filth Posted March 29, 2012 Report Share Posted March 29, 2012 2igoryk Кроха намекнул - у Тебя реализовано меню каталога на Jquery. Не поделишься? Quote Link to post Share on other sites
igoryk Posted March 29, 2012 Report Share Posted March 29, 2012 пиши мыло - поделюсь Quote Link to post Share on other sites
Kpoxa Posted March 29, 2012 Report Share Posted March 29, 2012 А в паблик? Quote Link to post Share on other sites
igoryk Posted March 29, 2012 Report Share Posted March 29, 2012 да без проблем - само меню :{* Рекурсивная функция вывода дерева категорий *}<div class=categories> {function name=categories_tree} {if $categories} <ul> {foreach $categories as $c} {* Показываем только видимые категории *} {if $c->visible} <li> {if $c->image}<img src="{$config->categories_images_dir}{$c->image}" alt="{$c->name}">{/if} <a {if $category->id == $c->id}class="selected"{/if} href="catalog/{$c->url}" data-category="{$c->id}">{$c->name}</a> {categories_tree categories=$c->subcategories} </li> {/if} {/foreach} </ul> {/if} {/function} {categories_tree categories=$categories}</div> Quote Link to post Share on other sites
igoryk Posted March 29, 2012 Report Share Posted March 29, 2012 в css - меняйте под себя как нужно - /* Каталог меню*/.categories ul, .categories li { margin: 0; list-style: none; background:url(../images/bg_sub.jpg) left repeat-y; } .categories a {color: #34627b; padding: 0 0 0 10px; border-bottom: solid 1px #fff; text-decoration: none; display: block; font: 13px/26px Tahoma, Arial; } .categories a:hover { text-decoration: underline;} .categories ul ul { /*background: #f9f9f8; */ padding: 2px 0 6px 14px; } .categories li.subcat { background: url(../images/li-subcat.png) no-repeat 198px 10px; } .categories ul ul li {background: url(../images/subcat-li.png) no-repeat 0px 10px;} .categories ul ul a, .categories li.active ul a {color: #34627b; text-decoration: underline; font: 12px/21px Tahoma, Arial; border: none; } .categories ul ul a:hover { text-decoration: none; } .categories li.active a, .categories li li.active a {font-weight: bold; color: #2f2e2e; } Quote Link to post Share on other sites
igoryk Posted March 29, 2012 Report Share Posted March 29, 2012 ну и обработчик -$(document).ready(function() { initMenu('.categories ul');function initMenu(id) { $(id + ' ul').hide().parent().addClass('subcat'); if($(id).find('li.active')) { $(id).find('li.active').parents('ul').show().parents('li').addClass('active'); } else $(id + ' ul:first').show(); $(id + ' a').click( function() { checkElement = $(this).next(); if(checkElement.is('ul')) { if(!checkElement.is(':visible')) {// $(id + ' ul:visible').slideUp('normal'); checkElement.slideDown('normal'); } else checkElement.slideUp('normal'); return false; } });} Quote Link to post Share on other sites
igoryk Posted March 29, 2012 Report Share Posted March 29, 2012 Единственное но - никак не могу "Зафиксировать" подкатегорию при переходе в неё - опять сворачивается ... Может кто поможет? Quote Link to post Share on other sites
Kpoxa Posted March 29, 2012 Report Share Posted March 29, 2012 Спасибо, положим на полочку и протестируем Quote Link to post Share on other sites
filth Posted March 29, 2012 Report Share Posted March 29, 2012 Урраааа!!! Quote Link to post Share on other sites
filth Posted March 30, 2012 Report Share Posted March 30, 2012 igoryk 00:46Единственное но - никак не могу "Зафиксировать" подкатегорию при переходе в неё - опять сворачивается ... Может кто поможет?Я помогу))) Только давай перейдём в Тему Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.