jarko90 Posted April 21, 2013 Share Posted April 21, 2013 Hi, i customized blockcategories to show categories in dropdown menu, it shows me but i dont know how to add link to option value from selected categories.. can you help me ? <form action="{$smarty.server.SCRIPT_NAME|escape:'htmlall':'UTF-8'}" method="get"> <select id="kateg"> <p> <option value="All categories">All categories</option> {foreach from=$blockCategTree.children item=child name=blockCategTree} {if $smarty.foreach.blockCategTree.last} {include file="$branche_tpl_path" node=$child last='true'} {else} <option value={include file="$branche_tpl_path" node=$child}</option> {/if} {/foreach} </p> </select> </form> Thank you Link to comment Share on other sites More sharing options...
NemoPS Posted April 22, 2013 Share Posted April 22, 2013 Hi, i don't think it's W3C compliant to put something but text/integers as value for the option tag. There is an abvious error in the fifth-last line. Also, even if it was like this <option> {include file="$branche_tpl_path" node=$child}</option> Which is the correct way to use option tags, i believe the branch contains html, and you can't do it either on option tags. That cose is all wrong anyway, you can't put p tags inside select boxes :/ Start from scratch, and do something like this: <select id="kateg"> <option value="All categories">All categories</option> {foreach from=$blockCategTree.children item=child name=blockCategTree} <option value="{$link->getCategoryLink($child.id_category)}">{$child.name}</option> {/foreach} </select> Just a demo, not sure if this will work, or it's referencing the correct variable names. My suggestion is to go back to the html basics, and study tags a bit more in depth Link to comment Share on other sites More sharing options...
jarko90 Posted June 7, 2013 Author Share Posted June 7, 2013 hi your code is not working actually :-/ ... Dropdown menu is loading names of categories, but it is not redirecting you to categories.. it doesnt load correct link to category any help ? :\ Link to comment Share on other sites More sharing options...
NemoPS Posted June 7, 2013 Share Posted June 7, 2013 Of course, you need to setup javascript, select boxes are not meant to redirect you once you click on them. Setup a js block with a change() event, then redirect to the current select box value Link to comment Share on other sites More sharing options...
Recommended Posts