2

I have created a Web Template but I haven't quite gotten my head around the Onet.xml file. I've Added some custom Web Parts and basically done most of the things that people suggest one would configure in the <Configuration> part of the onet.xml file.

The customization's all work and I can use the Web Template when creating sub sites. The problem comes when the sub site have been created.

The problem: The site have been created but the Title on the page isn't displayed.

When using Chrome Dev Tools:

enter image description here

When changing the onet.xml file to the #STS onet.xml (team site template's) the title is shown.

Question: I can't figure out why(where) the title is effected by(in) the onet.xml file. Is the page title "added" in the <NavBars> area in the onet.xml file.

3
  • What default page are you using? Or are you using a custom one? Then show us the markup of that .aspx file Commented Jan 23, 2014 at 8:39
  • 2
    The page title is controlled by the page of the default page, so really nothing in the WebTemplate onet.xml except for the feature provisioning the page Commented Jan 23, 2014 at 8:40
  • The "default.aspx" file I'm using is 'Team Site'. Commented Jan 23, 2014 at 8:44

2 Answers 2

3
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
         <label class="ms-hidden"><SharePoint:ProjectProperty Property="Title" runat="server"/></label>
</asp:Content>

This is a snippet from default.aspx in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\SiteTemplates\sts

As you can see, this default page has put the ms-hidden class on the title label. This class has CSS bound to it by default that hides it.

So either you have to create your own default.aspx and provision it, using the markup from C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\SiteTemplates\sts\default.aspx and remove the ms-hidden from the tag. (See here for details about how to provision the default page)

Or you could probably remove the class from the tag with the help of javascript (but that seems a bit overcomplicated and dirty)

1
  • Will give it a try later, thx for the response! Commented Jan 23, 2014 at 9:04
0
jQuery("#pageTitle label.ms-hidden").removeClass("ms-hidden")
1
  • 2
    If you add some description about the code and how to use it, then it will be great contribution.
    – Asad Refai
    Commented Mar 8, 2016 at 5:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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