Need to use an include of any kind


(ocultor) #1

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.


#2

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


(ocultor) #3

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)


#4

@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


(ocultor) #5

thanks, could you please post the file you modified?


#6

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


(ocultor) #7

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


#8

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


(ocultor) #9

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


#10

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