如何将动态描述添加到SharePoint 2010徽标/标题区域



我正在开发SP2010站点主模板。我想让网站设置->标题、说明和图标中的信息显示在标题区域。我可以让标题和徽标一起出现在整个网站上,然而,当我说图书馆时,描述会发生变化。

如果我尝试使用这个:

<div class="s4-pagedescription" tabindex="0" >
  <asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat="server"> </asp:ContentPlaceHolder>
</div>

当我进入列表或小节时,它会发生变化。。。我希望在站点设置中找到的描述是确定站点描述。

<table class="s4-titletable" cellspacing="0">
  <tbody>
    <tr>
      <td class="s4-titlelogo"><SharePoint:SPLinkButton runat="server" NavigateUrl="~site/" id="onetidProjectPropertyTitleGraphic">
          <SharePoint:SiteLogoImage name="onetidHeadbnnr0" id="onetidHeadbnnr2" LogoImageUrl="/Style Library/fsimages/logo.png" runat="server"/>
        </SharePoint:SPLinkButton></td>
      <td class="s4-titletext"><h1> 
          <!-- This is giving me the Title across the site no problem --->
          <asp:SiteMapPath runat="server" id="SiteMapPath1"></asp:SiteMapPath>
        </h1>
        <br/>
        <!-- HOW DO I GET THIS DESCRPTION DYNAMICALLY? -->
        <h2>(replace this with code to get description)</h2></td>
      <td class="s4-socialdata-notif"><SharePoint:DelegateControl ControlId="GlobalSiteLink3" Scope="Farm" runat="server"/></td>
    </tr>
  </tbody>
</table>

谢谢!

我不确定它是否能在母版页中工作,但在我曾经使用过"ProjectProperty"标记的页面布局中。

<asp:Content ID="Content1" ContentPlaceHolderId="PlaceHolderMain" runat="server">
<h1>
        Welcome to site: <SharePoint:ProjectProperty runat="server" Property="Title"> </SharePoint:ProjectProperty>!
</h1>
</asp:Content>

我认为您可以将"标题"替换为"描述"

最新更新