Friday, March 21, 2014

SharePoint App custom properties

This workaround is based on how to create the SharePoint hosted app using very basic level of "Twitter" widget.

How to prepare your twitter widget.
Steps
Login into your twitter account.
Click on the "Setting icon" in top of the right hand side.On pop up menu select the "Settings".
It will navigate to https://twitter.com/settings/account
On this page click the "Widget" on the "Configuration" select the desired settings such as height,width,theme,include replies and expand photos,based on this selection html tag and scripts will be generated.

Example : my twitter widget code to be placed on web page.



SharePoint hosted App with Custom Properties





Now create the SharePoint hosted app through visual studio 2012.
help link
http://msdn.microsoft.com/en-us/library/office/fp142379(v=office.15).aspx
All you need to do here is,add the "Client web part(hosted web).
Right click on the "SharePoint Project" ->Add New Item->Client WebPart (hosted web)
When you add you will be prompted to add this webpart in the existing page or in new page as shown in this picture.


Now go to your "WebPart's" Element.xml file and insert the properties like shown below.

Construct the content type xml node exactly same and see the Query value starts and ends with underscore.
Content Type="html" Src="~appWebUrl/Pages/TWP.aspx?TweetLimit=_TweetLimit_&theme=_theme_&IsReplyShow=_IsReplyShow_&" />


At run time you can change the number of tweets to be displayed and desired theme.

Download the code to learn more on  SharePoint app development

Source code.

       
       After this my App looks like this