Skip to content

How to pass a <button> element (with an id) to menu_item in shell component instead of a link? #910

Answered by lovasoa
amrutadotorg asked this question in Q&A
Discussion options

You must be logged in to vote

Hi !
SQLPage does not allow you to insert arbitrary elements as menu items without creating your own shell as a custom component.

But in your case, it sounds like you don't need it. You can create a normal menu item with

select 
    'shell' as component,
    JSON('{"link":"#xxx","title":"Install","icon":"download"}') as menu_item;

and then select it from your javascript with

document.querySelector("nav a[href='#xxx']") 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@amrutadotorg
Comment options

Answer selected by amrutadotorg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants