Need to use an include of any kind

Hi,

I need to use an include of any kind (js, php, etc) so I can use a menu file in a lot of documents, please help, html widgets won’t do what I need, any directions will be greatly appreciated.

Hi @ocultor, could you elaborate a little on this?

I mean do you need the same menu for your documents? What are you trying to create?

Do you have a menu that you have made and you want to reuse it?

Do you want to use a menu that has been made outside of Hype?

Let us know and I’ll see if I can help.

D

1 Like

thanks for your interest, I created a menu in hype, I needed it to be sticky at the top, and it has an animated submenu.

the problem is that I can’t use an iframe because it would overlap other content that needs to be clickable, the script that makes it sticky won’t allow me to use symbols, (I tried already), copying and pasting the menu across documents doesn’t work either (animation is lost)… So i’m at a stage where I need to change the menu in all the site file by file, layout by layout and each menu has a sticky duplicate counterpart which doubles the task, and they’re a lot of files, please see the attached document. thanks.

index.hype.zip (853.6 KB)

@ocultor,

I changed the menu to a persistent symbol (highlighted menu group and chose New persistent symbol from selection) and then changed the symbol’s id to menu_top and deleted the group’s id. That way you still have the animation going on and the symbol reacts to the javascript for the ‘sticky’ part. Now you can create new scenes with the persistent symbol in place. The javascript still has to be set in each scene’s ‘On Layout Load’ section but maybe this can be worked around by storing the functions outside of the document and calling them in once. I’m not great with javascript so not sure if this is possible or viable.

Hope this helps!

D

thanks, could you please post the file you modified?

sticky_symbols.hype.zip (1.0 MB)

Also just to add to your original query you can adjust the innerHTML of elements and load a complete file (the contents of) to the element. Below is a link to the method. I don’t know if this would help in any way.

http://api.jquery.com/load/

D

1 Like

Do you know how can I implement .load in hype? I wasn’t able to make it load, thanks

Hi

ok … so the following is if you want to load the contents of a file into an element.

$("#element").load("${resourcesFolderName}/contents.html");

This is using jQuery.

Just use this in a function and call it however you want.

Hope this is what you need.

D

i was missing the ${resourcesFolderName} part, will try again, thank you

no worries. Obviously that is to include it from your resources folder but you can also put an absolute url in there too for future reference.

D