Question

Mahesh02 on Thu, 18 Aug 2016 09:42:19


Hi Team,

Can we apply default Site Collection master page to SharePoint hosted app Page in Visual Studio?

Thanks & Regards,

k.Mahesh



Sponsored



Replies

Patrick_Liang on Fri, 19 Aug 2016 07:55:00


Hi Mahesh,

A possible way is that, you can make a copy of the default Site Collection master page, add it as a module in the App project, then this app will be able to apply this master page.

An article about Creating Custom Master Page for Hosted Apps should give you more information:

http://www.codeproject.com/Tips/817340/Creating-Custom-Master-Page-for-Hosted-Apps

Best regards,

Patrick

Mahesh02 on Mon, 22 Aug 2016 06:20:47


Hi Patrick,

Thanks for your reply.. i have done based on your steps, i took copy of Seattle masterpage and deployed using module then,successfully applied master page for my pages.

but i have two doubts. 

1. Lets take default.aspx in app, i have modified the master page url and deployed, so, it got successfully applied. But i am not able to edit the default.aspx page in ribbon. i can able to view only Browse Tab. 

So, how can i edit the page.?

2. In app, i have created the one list and deployed, but when open the list, custom master page not applied to the list.. (Ex: When i open the AllItems.aspx page of the list, Left navigation not populated, but when open the default .aspx page , navigation populated.) 

So, How can i apply custom master page to List also?

Thanks & Regards,

k. Mahesh


Patrick_Liang on Tue, 23 Aug 2016 11:33:30


Hi Mahesh,

1, Seems the suite bar doesn’t have the option which can enable users edit page in browser directly, I don’t have any idea about it right now either.

2, You need to set the master page as the “System master page” of the app web, then it can apply to all the pages:

http://www.c-sharpcorner.com/UploadFile/472cc1/changing-master-page-through-csom-in-sharepoint-2013/

https://msdn.microsoft.com/en-us/library/office/jj247153.aspx

https://msdn.microsoft.com/en-us/library/office/jj245057.aspx

Best regards,

Patrick