Jump Menu
Jump Menu
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
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
Re: Jump Menu
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.
Re: Jump Menu
Thanks Wishy, I'll have a look at that 

Re: Jump Menu
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.
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.
Re: Jump Menu
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.

I'll post the code as soon as I get home after work.

Re: Jump Menu
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]
I hope that it's useful
Steve

If you use it, remember to change the postfix from 'txt' to 'php'
[attachment deleted by admin]
Re: Jump Menu
Hi Steve, thanks for the script. I have a problem however.
This is what I entered in the page:
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]
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]
Re: Jump Menu
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
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
Re: Jump Menu
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.
Re: Jump Menu
Thanks so far.... but..
I'm sure its a dumb question but what javascript do I need and where can I find that?
Hans
I'm sure its a dumb question but what javascript do I need and where can I find that?
Hans
Re: Jump Menu
This:Hans wrote: I'm sure its a dumb question but what javascript do I need and where can I find that?
Hans
Code: Select all
<__script__ languange="javascript">
function jumpBox(list) {
location.href = list.options[list.selectedIndex].value
}
</__script>
Re: Jump Menu
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 .
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 .
Re: Jump Menu
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.
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.
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"}
(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.
Re: Jump Menu
You jumpmenu works fine - but with pimenu very easy:
Here the Template:
Don't forget to set the little Javascript in your Maintemplate
With Pimenu it was easy 5 Minutes.
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>
Code: Select all
<__script__ languange="javascript">
function jumpBox(list) {
location.href = list.options[list.selectedIndex].value
}
</__script>