1
turnerrw
Javascript Menu & Site Context Problems
  • 2005/12/13 16:48

  • turnerrw

  • Just popping in

  • Posts: 68

  • Since: 2003/12/1


I'm having a bit of trouble getting the final touches on a dynamic menu. I found a pretty good dynamic javascript menu from http://www.deluxe-menu.com. It's got good flexibility and a good GUI builder tool. I added the required javascript references to the headers of theme.html and added code to a custom HTML block.

The problem I found was that the menu only rendered properly on the front page. Once I changed to a module page, the custom block was empty. I know this is due to the script references pointing to a now non-existant directory.



My workaround was to put the javascript code into an .shtml file and put an iframe in the block. This just feels like a rough workaround and not very elegant. If I knew more about XOOPS development, I guess I could create a module, but that's beyond my education at the moment.

Does anyone have any ideas on how I can maintain context for this menu across my entire site? Here are the code particulars.

MENU: http://www.deluxe-menu.com/

SITE: http://69.16.202.42/~campfire/

.SHTML file - http://69.16.202.42/~campfire/menu.shtml

Puzzled...
-Robert

2
turnerrw
Re: Javascript Menu & Site Context Problems
  • 2005/12/13 17:17

  • turnerrw

  • Just popping in

  • Posts: 68

  • Since: 2003/12/1


Just did some more testing and the iFrame causes any links to be returned to that section of the page --- which of course won't work!

UGH! What started out as a "simple project" has turned into a monster. Need some expert advice from the XOOPS Wizards!!

3
turnerrw
Re: Javascript Menu & Site Context Problems
  • 2005/12/13 17:47

  • turnerrw

  • Just popping in

  • Posts: 68

  • Since: 2003/12/1


My workaround solution is to copy menudir to the root of each module directory. This let's me take the code out of the iFrame. This is still a rough, non-elegant workaround.

Still keen on hearing from any experts on how to do this better.

Cheers,
-Robert

4
wtravel
Re: Javascript Menu & Site Context Problems

In order to have your script found you should use the full file path. In your theme.html file put:




Best regards,

Martijn

5
turnerrw
Re: Javascript Menu & Site Context Problems
  • 2005/12/13 18:18

  • turnerrw

  • Just popping in

  • Posts: 68

  • Since: 2003/12/1


Quote:

wtravel wrote:
In order to have your script found you should use the full file path. In your theme.html file put:




Excellent Martijn, I'll make that change.

I'm still concerned about one item though - here is the text from the developer's FAQ

Quote:

Make sure that the var dmWorkPath parameter that is in the html page has the correct path to the .js files of a menu and do NOT begin with "/" character:

var dmWorkPath = "/menudir/"; - incorrect
var dmWorkPath = "menudir/"; - correct


I've placed these files in a menudir directory on the docroot of the site. How can I address this issue? My workaround was to place a copy of the menudir directory in each module, but that's a messy solution. What I'd like to do is to use the syntax you reference above for this variable. According to the developer, that won't work.

SO it seems, I'm left with merging 5 javascripts into 1 file.

Is there another solution?

Cheers,
-Robert

6
wtravel
Re: Javascript Menu & Site Context Problems

What if you try this:
Quote:

var dmWorkPath = <{$xoops_rootpath}>."/menudir/";

7
turnerrw
Re: Javascript Menu & Site Context Problems
  • 2005/12/13 21:00

  • turnerrw

  • Just popping in

  • Posts: 68

  • Since: 2003/12/1


I'll give it a shot. Right now I just noticed that while the menu works in Firefox, it does not display submenus in IE. UGH!

8
turnerrw
Re: Javascript Menu & Site Context Problems
  • 2005/12/13 21:10

  • turnerrw

  • Just popping in

  • Posts: 68

  • Since: 2003/12/1


Quote:

turnerrw wrote:
I'll give it a shot. Right now I just noticed that while the menu works in Firefox, it does not display submenus in IE. UGH!


it didn't work. I got the infamous sticking menu problem. Now back to trying to figure out why IE is coughing on this menu.

9
wtravel
Re: Javascript Menu & Site Context Problems

Of course it does not work... . What about this?
Quote:



10
wtravel
Re: Javascript Menu & Site Context Problems

Of course it does not work... . What about this?
Quote:



Login

Who's Online

373 user(s) are online (318 user(s) are browsing Support Forums)


Members: 0


Guests: 373


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits