Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Trigger Side Menu with toggleNavUi() function

Benoit_Leray
Level 2
Level 2

Hi,

looking at benefit from the HTML Gesture API, I'm wondering if there is any parameter to pass to the toggleNavUi() function in order to display not only the Top Nav menu, but the side  menu.

What I'm trying to achieve, is having a hamburger icon straight into my article, than onClick event can display the side menu.

Until now, I reproduce this behavior by having some extra function that display a side menu right inside the article. But I don't like this approach, as it add additional js layer to maintain inside the article.

1 Accepted Solution
NMarroquin
Correct answer by
Employee
Employee

Hi Benoit, there isn't any such parameter in the gesture API, your current approach with your own custom menu is the only workaround. Have you considered making the JS layer global so that it's maintained as a single element shared across multiple articles? That requires using the API to upload shared resources, but it may reduce some of your overhead.

View solution in original post

2 Replies
NMarroquin
Correct answer by
Employee
Employee

Hi Benoit, there isn't any such parameter in the gesture API, your current approach with your own custom menu is the only workaround. Have you considered making the JS layer global so that it's maintained as a single element shared across multiple articles? That requires using the API to upload shared resources, but it may reduce some of your overhead.

View solution in original post

Benoit_Leray
Level 2
Level 2

Thanks Nathan.

So you confirm my assumption. I'm already using the shared content with the API to share my .js files.

I learn in the documentation, that when using shared content, viewer will have to download the whole shared entity before displaying content.

My preview app still pretty small and light, but final content might become huge to download if all articles are part of the same shared entity.

Or maybe I missed a point in this shared entity approach.

Can an article refering to several shared entity? How to achieve that?