How to change name of container id after advanced export

How can you change the id of the container when exporting an animation?

I have a web page that contains multiple Hype exported animations. But I think because they have the same container id, it causes problems.

I recommend exporting with separate names during export if you need multiple different Hype documents on the same page. Are you accessing the ID with JavaScript somehow? If you change the container ID after export, the Hype JavaScript will not know what container to use and it will fail.

Also, I recommend using a CDN URL for the Hype runtime to avoid downloading that file more than once.

Hi Daniel, we’re indeed exporting the hype documents with different names. However, Hype gives them all the container id div id=“default_hype_container”.

I don’t think it’s possible to just change the container id by hand. It would be possible to do this in the html code referencing the Hype javascript file. But default_hype_generated_script.js also contains the container id, and we can’t just change it in that file.

The page that has multiple Hype documents: Hype animation 1 seems to adopt from Hype animation 2, I guess because they have the same container id.

Are you exporting using an Export script? The ID of the div should be prepended with the document name (or filename chosen during export). (Using Hype 1.6.2 and Hype 3.6.3)

If you export using the name xxxx, the Div id will be: xxxx_hype_container.

No, I’m using “Advanced export” in Hype:

  • Custom slices: Default
  • Export script: None
  • Individual slices: none selected

It then exports in a folder (which is the name I’ve given the Hype document). In that folder there’s index.html and a folder called Default with all the other files.

The default name comes from the default name (which is Default) you have set for the slice. Double click on that to rename, or export individual scenes (which will use their scene name as the slice + export name)

3 Likes

Quite unfortunate in our use case:
We do a lot of small data viz within the content; to use the CDN we need to use the Advanced Export but then we need to rename each Slice of each document …:scream:

Note that the slice names gets saved, so you only will have to name it once (which you’d have to do in any export situation!).

1 Like