0

I need to add new menu items to the welcome menu in SP 2013 using javascript/jquery. How can this be done?

Additions to #welcomeMenuBox dont work for me.

1 Answer 1

1

modify the ServerMenu - it's the source for the rendering of the welcomeMenuBox.

try something like this:

var newItem = document.createElement('ie:menuitem')
newItem.setAttribute('type', 'option')
newItem.setAttribute('onmenuclick', 'STSNavigate2(event, "https://google.de")')
newItem.setAttribute('text', 'Google')
newItem.setAttribute('description', 'open google and have fun')
newItem.setAttribute('menugroupid', '100')
document.querySelector('#welcomeMenuBox menu[type="ServerMenu"]').append(newItem)

and the result will be

enter image description here

if you set the menugroupid to something other than 100 the result will look like:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.