Where are the instructions how to use the latest version of the widget plugin api


#1

Hi,

There’s a few things I can’t make out how to do in the later versions of the widget api. Before it was very convenient where one could just add ‘icon’, ‘label’, ‘href’ etc to for example a menu link. In particular I’d like to know how to add a font-awsome icon with the virtual-dom api. Any instructions would be nice.

/david


#2

Manged to use the virtual dom to create a copy of what something like this:

return { href: '/link', label: 'main_menu.link.title', icon: 'link-o' }

would return in the dom. But my links reload the whole page now. Is there a better way of creating menu links? Here is what i add to menu-links:after:

h('li', h('a.widget-link', {'href': '/link'}, [
  h('i.fa.fa-link', {"style": "margin-right: 4px;"}),
  h('span', I18n.lookup('main_menu.link.title'))
])) 

This link reloads the whole page with the pathname.