Anonym Posted July 12, 2012 Share Posted July 12, 2012 Nu stiu din ce cauza meniul meu pentru categorii nu e dinamic desi e setat din back ofiice pe dynamic 1. Acuma sunt afisate toate categoriile si subcategoriile .Vreau sa fie afisate doar categoriile si eventual cand dai click pe o categorie atunci sa se deschida subcategoriile. Folosesc versiunea 1.3.6.0 si Categories block v1.0 .Are cineva vreo idee ? E posibil sa fie modificat ceva prin fisierele modulului? Link to comment Share on other sites More sharing options...
urecheatu007 Posted July 16, 2012 Share Posted July 16, 2012 Salut, da-ne si noua un url al magazinului sa ne putem uita. La o prima ocheada pare sa fie un conflict de javascript. Link to comment Share on other sites More sharing options...
Anonym Posted July 16, 2012 Author Share Posted July 16, 2012 https://etigara-electronica.ro/ dynamic e setat pe 1 dar nu are nici un efect . Link to comment Share on other sites More sharing options...
urecheatu007 Posted July 16, 2012 Share Posted July 16, 2012 Oki, in primul rand ar fi bine sa stii un pic de programare, pentru ca e o problema care tine de javascript / css /html. Acum meniul de categorii este un ul cu clasa lista. Pagina incarca un javascript treemanagement care presupun ca e cel care ar trebui sa se ocupe de ascunderea deschiderea categoriilor (el face parte din tema default oricum). Acest js se initializeaza pentru un ul cu 2 clase tree si dhtml. Inainte de a incerca altceva editeaza template-ul pentru blocul de meniu si pune in loc de <ul class="lista"> -> <ul class="lista tree dhtml"> si vezi daca merge. Oricum tema e facuta cam ciudatel si bag seama ca a suferit si ceva modificari. In mod normal ar trebui sa gasesti template-ul modulului de categorii in /themes/theme001/modules/blockcategories/blockcategories.tpl Daca tema nu foloseste corect override-urile gasesti template-ul in /modules/blockcategories/blockcategories.tpl. Ca sa fii sigur ca la eventuale update-uri nu se suprascrie acest template poti crea un folder modules cu un alt subfolder in el numit blockcategories in /themes/theme001/ in care copiezi fisierul .tpl din modules/blockcategories Link to comment Share on other sites More sharing options...
Anonym Posted July 16, 2012 Author Share Posted July 16, 2012 (edited) In /themes/theme001/modules/ nu am blockcategories doar productscategory in care am productscategory.tpl si ceva folder js si inca ceva fisiere .Nu stiu daca asta are legatura cu meniul dar continutul fisierului productscategory.tpl este {if count($categoryProducts) > 0} <script type="text/javascript">var middle = {$middlePosition};</script> <script type="text/javascript" src="{$content_dir}modules/productscategory/js/productscategory.js"></script> <ul class="idTabs"> <li><a href="#idTab3">{l s='ASEMANATOARE' mod='productscategory'}</a></li> </ul> <div id="{if count($categoryProducts) > 5}productscategory{else}productscategory_noscroll{/if}"> {if count($categoryProducts) > 5}<a id="productscategory_scroll_left" title="{l s='Previous' mod='productscategory'}" href="javascript:{ldelim}{rdelim}">{l s='Previous' mod='productscategory'}</a>{/if} <div id="productscategory_list"> <ul {if count($categoryProducts) > 5}style="width: {math equation="width * nbImages" width=107 nbImages=$categoryProducts|@count}px"{/if}> {foreach from=$categoryProducts item='categoryProduct' name=categoryProduct} <li {if count($categoryProducts) < 6}style="width: {math equation="width / nbImages" width=94 nbImages=$categoryProducts|@count}%"{/if}> <a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category)}" title="{$categoryProduct.name|htmlspecialchars}"> <img src="{$link->getImageLink($categoryProduct.link_rewrite, $categoryProduct.id_image, 'medium')}" alt="{$categoryProduct.name|htmlspecialchars}" /> </a><br/> <a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category, $categoryProduct.ean13)}" title="{$categoryProduct.name|htmlspecialchars}"> {$categoryProduct.name|truncate:15:'...'|escape:'htmlall':'UTF-8'} </a> </li> {/foreach} </ul> </div> {if count($categoryProducts) > 5}<a id="productscategory_scroll_right" title="{l s='Next' mod='productscategory'}" href="javascript:{ldelim}{rdelim}">{l s='Next' mod='productscategory'}</a>{/if} </div> {/if} Am modificat in /modules/blockcategories/blockcategories.tpl <ul class="lista tree dhtml"> dar uite cum apare dupa ce am salvat . http://i49.tinypic.com/53n5mo.png Edited July 16, 2012 by Anonym (see edit history) Link to comment Share on other sites More sharing options...
urecheatu007 Posted July 16, 2012 Share Posted July 16, 2012 (edited) productscategory nu are nicio treaba, este template-ul pentru modulul care afiseaza in pagina de produs alte produse din aceeasi categorie. In privinta imaginii, apare asa pentru ca cele 2 clase de css in afara de rolul de carlig pentru js controleaza si afisarea. Alternativ poti face modificarea direct in /themes/theme001/js/tools/treeManagement.js si lasi ul-ul doar cu clasa lista. Mai exact inlocuiesti peste tot unde apare ul.tree.dhtml cu ul.lista si ar trebui sa functioneze partea dinamica. Vezi mai jos cam cum ar trebui sa apara partea implicata din fisier: //when the page is loaded... $(document).ready(function () { //to do not execute this script as much as it's called... if(!$('ul.lista').hasClass('dynamized')) { //add growers to each ul.tree elements $('ul.lista ul').prev().before("<span class='grower OPEN'> </span>"); //dynamically add the '.last' class on each last item of a branch $('ul.lista ul li:last-child, ul.lista li:last-child').addClass('last'); //collapse every expanded branch $('ul.lista span.grower.OPEN').addClass('CLOSE').removeClass('OPEN').parent().find('ul:first').hide(); $('ul.lista').show(); //open the tree for the selected branch $('ul.lista .selected').parents().each( function() { if ($(this).is('ul')) toggleBranch($(this).prev().prev(), true); }); toggleBranch( $('ul.lista .selected').prev(), true); //add a fonction on clicks on growers $('ul.lista span.grower').click(function(){ toggleBranch($(this)); }); //mark this 'ul.tree' elements as already 'dynamized' $('ul.lista').addClass('dynamized'); $('ul.lista').removeClass('dhtml'); } }); Edited July 16, 2012 by urecheatu007 (see edit history) Link to comment Share on other sites More sharing options...
Anonym Posted July 16, 2012 Author Share Posted July 16, 2012 mersi mult functioneaza .Daca intru pe o categorie care are mai multe subcategorii se poate sa fac sa ramana afisate subcategoriile sa nu se inchida automat ? Link to comment Share on other sites More sharing options...
urecheatu007 Posted July 16, 2012 Share Posted July 16, 2012 (edited) Pai vezi ca in /modules/blockcategories/category-tree-branch.tpl in sablonul implicit se seteaza o clasa active pentru categoria curenta si in js arborele respectiv este pastrat expandat. Uite aici continutul original: <li {if isset($last) && $last == 'true'}class="last"{/if}> <a href="{$node.link|escape:'htmlall':'UTF-8'}" {if isset($currentCategoryId) && $node.id == $currentCategoryId}class="selected"{/if} title="{$node.desc|escape:'htmlall':'UTF-8'}">{$node.name|escape:'htmlall':'UTF-8'}</a> {if $node.children|@count > 0} <ul> {foreach from=$node.children item=child name=categoryTreeBranch} {if $smarty.foreach.categoryTreeBranch.last} {include file="$branche_tpl_path" node=$child last='true'} {else} {include file="$branche_tpl_path" node=$child last='false'} {/if} {/foreach} </ul> {/if} </li> si asta este continutul original pentru blockcategories.tpl: <!-- Block categories module --> <div id="categories_block_left" class="block"> <h4>{l s='Categories' mod='blockcategories'}</h4> <div class="block_content"> <ul class="tree {if $isDhtml}dhtml{/if}"> {foreach from=$blockCategTree.children item=child name=blockCategTree} {if $smarty.foreach.blockCategTree.last} {include file="$branche_tpl_path" node=$child last='true'} {else} {include file="$branche_tpl_path" node=$child} {/if} {/foreach} </ul> {* Javascript moved here to fix bug #PSCFI-151 *} <script type="text/javascript"> // <![CDATA[ // we hide the tree only if JavaScript is activated $('div#categories_block_left ul.dhtml').hide(); // ]]> </script> </div> </div> <!-- /Block categories module --> PS: nu stiu daca e oki sa copiezi integral ce e mai sus pentru ca eu le-am luat din 1.5 nu din 1.4, cel mai bine e sa downloadezi versiunea pe care o ai tu instalata si sa te uiti in ea cum sunt cele 2 sabloane. Edited July 16, 2012 by urecheatu007 (see edit history) Link to comment Share on other sites More sharing options...
Anonym Posted July 16, 2012 Author Share Posted July 16, 2012 am copiat doar in category-tree-branch.tpl ,ce aveam eu acolo era total diferit am sters tot si am pus ce mi-am dat tu .Totul pare sa functioneze bine .Pot fi ceva probleme care nu se observa? Link to comment Share on other sites More sharing options...
urecheatu007 Posted July 16, 2012 Share Posted July 16, 2012 In principiu daca totul pare oki si se expandeaza corect nu prea ar avea de unde sa fie probleme. Daca ar fi fost le vedeai instant Link to comment Share on other sites More sharing options...
Anonym Posted July 16, 2012 Author Share Posted July 16, 2012 Ok , multumesc mult raman dator . Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now