Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > jQuery Mobile & html5 tags View modes: 
User avatar
Member
Member
Giuliano - 1/17/2012 10:42:53 AM
   
jQuery Mobile & html5 tags
Hi,

We are building jQuery Mobile website and we need specific tags applied to menu list items. For example, jQuery Mobile is looking for tag data-icon="search" in order to add icon to menu item.

Does anyone has any experience how this can be achieved, other than hardcoding or creating new document type that will duplicate main menu and then add necessary fields there.

How difficult would be to add new property under Properties > Menu, for example just above Menu Item Style text box where we would be able to insert any html5 tag.

Thanks.

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/18/2012 2:10:49 AM
   
RE:jQuery Mobile & html5 tags
Hello,

I think, that would be easiest to add a new filed to the Page (menu item) document file, which will represent html5 attributes for that menu item and you will generate a menu through a transformation, in which you can render html5 attributes from your new field.

If you don't want to change the way you render the menu and you want to only add those attributes somehow into a menu item, you can use mentioned Menu item style field in the Menu section under the Properties tab and you can "hack" this field with the html5 attributes (by closing this attribute and opening your one):
" data-icon="search

Best regards,
Jan Hermann

User avatar
Member
Member
Giuliano - 1/18/2012 8:17:16 AM
   
RE:jQuery Mobile & html5 tags
Thanks Jan,

That is exactly what we end up doing. We added new fields into Page (menu item) for html5, description and icon, and created new trasformation to render new menu properly. All is good now and we have working jQuery Mobile menu webpart.

Thanks for the "hack". Good to know that for quick fixes.

Have a great day,
Giuliano