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

时间:2012-02-09 22:04:15

标签: sharepoint 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>

谢谢!

1 个答案:

答案 0 :(得分:0)

我不确定它是否可以在母版页中使用,但在页面布局上我曾使用过“ProjectProperty”标记。

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

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