Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Is this JavaScript insertion possible? 
 
Reben002
Member
 
Total Posts:  41
Joined:  2009-02-13
 

Hello there people

I’ve been struggling with inserting of a specific JavaScript. Basically it’s a dropdown listbox to replace my navigation bar. After a week of intense frustration and trying almost everything i’ve been reading on the web forums I give up..

Where shall i put the drop-down javascript?
Wich of the .pthml docs should i implecate the code and associate it with a requested css template?

Here is an example of what i would like to achieve!
So please guys, heelp me…

Image Attachments
pad.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
Reben002
Member
 
Total Posts:  41
Joined:  2009-02-13
 

OK i’ve think i figured out somthing here but need some more advices :D

1.

I write down the java function in js map like js/varien/dropdown.js

function dropdownmeny() {
var URL document.menyform.listmeny.options[document.menyform.listmeny.selectedIndex].value;

[removed].href URL;

2. In the default\default\layout\page.xml i add

<action method="addJs">
  <
script>varien/dropdown.js</script> 
  
</action>

3.
Now there do I intregrate this code that in a normal html document should be between the <body> and </body>

<form name="menyform">
<
select name="listmeny" onChange="dropdownmeny()">

<
option selected value="Välj menyval">Välj menyval</option>
<
option value="[color=blue]some sort of php link[/color]">[color=red]Some sort of label[/color]</option>

//(show do i get it to continue to show all categories including subcategories?)//

</select>
</
form>

Know that was much at one time, but would be extremly thankful for anykind if help :D

Then i have so idea what to do now, shall i integrate it with template/catalog/navigation/left.phtml ??

POssible?

Image Attachments
pad.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top