我已经创建了一个 web模板,但我没有完全围绕 onet.xml文件。我添加了一些自定义Web部件,基本上完成了人们建议一个人在oneT.xml文件的<Configuration>部分中配置的大部分内容。

自定义所有工作,我可以在创建子站点时使用Web模板。创建子站点时,问题会出现。

问题: 该站点已创建,但未显示页面上的标题。

使用Chrome Dev工具:

将oneet.xml文件更改为#sts onet.xml(团队站点模板)显示标题。

问题:我无法弄清楚为什么(其中)标题由oneT.xml文件实现。 是在oneT.xml文件中的<NavBars>区域中的页面标题“添加”。

有帮助吗?

解决方案

<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)

其他提示

jQuery("label").removeClass("ms-hidden");
许可以下: CC-BY-SA归因
scroll top