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

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, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.