Forums / Setup & design / Drop down menu in eZ Publish-4.01 - SOLVED

Drop down menu in eZ Publish-4.01 - SOLVED

Author Message

Sejal Paliwal

Tuesday 04 November 2008 2:41:06 am

I am a newbie to eZ Publish. I wanted to create a drop down menu which consist of a list with external links.
Details - I want to create a drop down menu with the heading - "Categories".
And the drop down consist of a list such as books, shoes, clothings etc. Now, on selecting any one from the dropdown, the user is redirected to the embedded link.

Kindly help.

Andreas Kaiser

Tuesday 04 November 2008 4:59:13 am

Hi,

To clear it, what classes are "books, shoes, clothings"? Are these objects/nodes under a specific node?

Could you post the code you are using... This would be the best to try to help you...

eZ Partner in Madrid (Spain)
Web: http://www.atela.net/

Sejal Paliwal

Tuesday 04 November 2008 11:18:17 pm

Thanks .

To be more appropriate, I have a Product class- books.
Now I want to add different stores from where the books can be made available, I want to list these stores in a drop down menu, wherein all the items listed in the menu are links.

More specifically, I want to add the "Also Available from" functionality that is similar to the one on http://www.packtpub.com/joomla-version-1-5/book.

I tried adding the Selection attribute to the product class, but am not able to implement the dropdown functionality on the page.

Then, I added the following code in .../full/product.tpl-

<h3>Also Available From</h3> 
<form method="post" action= " " >
<select name="url">
<option value="http://www.alfresco.com">alfresco</option>
<option value="http://www.lob.de/">lehmans</option>
<option value="http://www.bookware.com.au/cgi-bin/bookware">bookware</option>
</select>
<input type="submit" value="Go!" />
</form>

The above code got me the dropdown menu, but without the redirecting links.
How to activate the links?

Kindly help me with the code to implement it.

Thanks in advance!

Sejal Paliwal

Thursday 13 November 2008 2:14:57 am

Solved by adding following code.

<script language="javascript" type="text/javascript">
<!--
function menu_goto( menuform )
{

    var baseurl = "http://mydomain.com" ;
    selecteditem = menuform.newurl.selectedIndex ;
    newurl = menuform.newurl.options[ selecteditem ].value ;
    if (newurl.length != 0) {
      location.href = baseurl + newurl ;
    }
}
//-->
</script>