Jump Menu

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
steve
Forum Members
Forum Members
Posts: 70
Joined: Mon Apr 11, 2005 12:31 pm

Jump Menu

Post by steve »

Hi All,

I need to add a jump menu toa a site that the end user will be able to edit in the admin. At the moment I have just supplied some extensive notes one how to edit the the html. I'm a little scared of this but it's my only option at the moment.

The current jump menu can be seen here:
http://www.polypostalpackaging.co.uk/index.php

I was wondering how difficult it would be to tweek the FeedbackForm module to do this. It seems simple, turn off the submit button and add an 'onChange' javascript in the form and add the corresponding function someplace.

I have just had a look at the FeedbackForm code and thought that I'd better ask for some advice before I start hoookying aroung in there.

Any advice appreciated

Steve
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

Re: Jump Menu

Post by Ted »

To be honest, I think you could take bulletmenu and modify the output into a select box without too much trouble.  Would have to write a little javascript to grab the url value and redirect to it onChange, but it should be pretty simple.
steve
Forum Members
Forum Members
Posts: 70
Joined: Mon Apr 11, 2005 12:31 pm

Re: Jump Menu

Post by steve »

Thanks Wishy, I'll have a look at that :)
steve
Forum Members
Forum Members
Posts: 70
Joined: Mon Apr 11, 2005 12:31 pm

Re: Jump Menu

Post by steve »

iNSiPiD

Re: Jump Menu

Post by iNSiPiD »

Did u do all this for one link?

If you've gone to the trouble of converting the bulletmenu code to output as a select box I'd be interested in seeing the code.

Thanks! Nice site by the way.
steve
Forum Members
Forum Members
Posts: 70
Joined: Mon Apr 11, 2005 12:31 pm

Re: Jump Menu

Post by steve »

Nope, It all just works like the bullet menu but spits out a drop down.
I'll post the code as soon as I get home after work.

:)
steve
Forum Members
Forum Members
Posts: 70
Joined: Mon Apr 11, 2005 12:31 pm

Re: Jump Menu

Post by steve »

I've attached the bulletmenu/jumpmenu script.
I hope that it's useful
Steve
:)
If you use it, remember to change the postfix from 'txt' to 'php'

[attachment deleted by admin]
Hans
Forum Members
Forum Members
Posts: 61
Joined: Sun Oct 09, 2005 10:49 am

Re: Jump Menu

Post by Hans »

Hi Steve, thanks for the script. I have a problem however.
This is what I entered in the page:

Code: Select all

{jumpmenu collapse="0" show_root_siblings="1" number_of_levels="3"}

The image shows what I get.
I played a bit with other parameters, but that didn't work.
Did I do something wrong or is there more that should be done?


Thanks Hans


[attachment deleted by admin]
steve
Forum Members
Forum Members
Posts: 70
Joined: Mon Apr 11, 2005 12:31 pm

Re: Jump Menu

Post by steve »

hmmm, I'm not sure.

To be honest I'm a bit of PHP newbie so I may not be able to help. I'm off outta town this weekend but I will take a look when I get back.

Have a good weekend

Steve
Svenni

Re: Jump Menu

Post by Svenni »

Don't forget to attach the Javascript if you want to run it correctly ... but I have a question, too: Where is the best place to place ist?
Last edited by Svenni on Fri Oct 28, 2005 4:26 pm, edited 1 time in total.
Hans
Forum Members
Forum Members
Posts: 61
Joined: Sun Oct 09, 2005 10:49 am

Re: Jump Menu

Post by Hans »

Thanks so far.... but..
I'm sure its a dumb question but what javascript do I need and where can I find that?
Hans
Svenni

Re: Jump Menu

Post by Svenni »

Hans wrote: I'm sure its a dumb question but what javascript do I need and where can I find that?
Hans
This:

Code: Select all

<__script__ languange="javascript">
function jumpBox(list) {
  location.href = list.options[list.selectedIndex].value
}
</__script>
Svenni

Re: Jump Menu

Post by Svenni »

Now I have one more question, too: Is there a way to show only the Pages under the actual site without define start_element? E. g.:

1.1
1.2
2
2.1
2.1.1
2.1.2
2.1.2.1
2.1.2.2
2.1.2.3

Now I'm staying on page 2.1.2 and want only show 2.1.2.1 ... 2.1.2.3 .
Hans
Forum Members
Forum Members
Posts: 61
Joined: Sun Oct 09, 2005 10:49 am

Re: Jump Menu

Post by Hans »

Hi Svenni
I don't know where you put the script. I placed it in the header of the template, surrounded by {literal} {/literal}
It works now to the extent that one link brings me to that page, but my problem as mentioned before is still there (see image)
Hans

[EDIT]
OK, I added this in the body of the template, together with the script in the header as mentioned above and so far it works for 1 level.

Code: Select all

{jumpmenu collapse="0" show_root_siblings="1" number_of_levels="2" start_element="1"}
I will see tomorrow what these parameters do (from bulletmenu)

(optional) showadmin - 1/0, whether you want to show or not the admin link.
(optional) collapse - 1/0, whether you want to collapse sub items that shouldn't be shown. Defaults to 0.
(optional) start_element - the hierarchy of your element (ie : 1.2 or 3.5.1 for example). This parameter sets the root node of the menu and only shows it and it's children.
(optional) show_root_siblings - 1/0, if start_element (above) is given, then show direct siblings of the give start_element as well.
(optional) number_of_levels - an integer, the number of levels you want to show in your menu.
Last edited by Hans on Fri Oct 28, 2005 5:33 pm, edited 1 time in total.
Piratos

Re: Jump Menu

Post by Piratos »

You jumpmenu works fine - but with pimenu very easy:

Here the Template:

Code: Select all

<div>
<form>
<select name="pulldown" onChange="jumpBox(this.form.elements[0])">
<option>---Please select---</option>
{foreach from=$rawmenu item=entry}
{if $entry->url neq ''}
{if $entry->type eq 'separator'}
<option>------</option>
{else}
<option value="{$entry->url}">{$entry->menutext}</option>
{/if}
{/if}
{/foreach}
</select>
</form></div>

Don't forget to set the little Javascript in your Maintemplate

Code: Select all

<__script__ languange="javascript">
function jumpBox(list) {
  location.href = list.options[list.selectedIndex].value
}
</__script>
With Pimenu it was easy 5 Minutes.
Post Reply

Return to “Modules/Add-Ons”