Tuesday 11 December 2012

SharePoint Web Part Zone Resources File

Eureka! 

For ages I have been wondering: I like those friendly titles at the top of Web Part Zones that convert the ugly mark-up text (like: Title="<%$Resources:cms,WebPartZoneTitle_TopLeft%>")  into pretty, human readable Zone names (like: "Top Left Zone" or "Bottom Right Zone").

I've always wanted to know: a) a definitive list of them; and b) how I can create more of them.

Well, a 12-zone, metro-styled page finally took me to breaking point and I hit Google to get to the bottom of this.

Here is what I found:

They are located (for SharePoint 2013), on the server in the following location:

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\Resources

Don't have server access? That is OK, here is a complete list of all the options that are available to you:

  <data name="WebPartZoneTitle_BottomLeft" xml:space="preserve">
    <value>Bottom Left Zone</value>
  </data>

  <data name="WebPartZoneTitle_BottomRight" xml:space="preserve">
    <value>Bottom Right Zone</value>
  </data>

  <data name="WebPartZoneTitle_LeftColumn" xml:space="preserve">
    <value>Left Column</value>
  </data>

  <data name="WebPartZoneTitle_RightColumn" xml:space="preserve">
    <value>Right Column</value>
  </data>

  <data name="WebPartZoneTitle_Top" xml:space="preserve">
    <value>Top</value>
  </data>

  <data name="WebPartZoneTitle_MiddleLeft" xml:space="preserve">
    <value>Middle Left Zone</value>
  </data>

  <data name="WebPartZoneTitle_MiddleRight" xml:space="preserve">
    <value>Middle Right Zone</value>
  </data>

  <data name="WebPartZoneTitle_Bottom" xml:space="preserve">
    <value>Bottom Zone</value>
  </data>

  <data name="WebPartZoneTitle_Header" xml:space="preserve">
    <value>Header</value>
  </data>

  <data name="WebPartZoneTitle_Footer" xml:space="preserve">
    <value>Footer</value>
  </data>

  <data name="WebPartZoneTitle_TopLeft" xml:space="preserve">
    <value>Top Left</value>
  </data>

  <data name="WebPartZoneTitle_TopRight" xml:space="preserve">
    <value>Top Right</value>
  </data>

  <data name="WebPartZoneTitle_CenterLeft" xml:space="preserve">
    <value>Center Left</value>
  </data>

  <data name="WebPartZoneTitle_Center" xml:space="preserve">
    <value>Center</value>
  </data>

  <data name="WebPartZoneTitle_CenterRight" xml:space="preserve">
    <value>Center Right</value>
  </data>

  <data name="WebPartZoneTitle_Right" xml:space="preserve">
    <value>Right</value>
  </data>  

 <data name="WebPartZoneTitle_Left" xml:space="preserve">
    <value>Left</value>
  </data>

  <data name="WebPartZoneTitle_BottomCenter" xml:space="preserve">
    <value>Bottom Center</value>
  </data>

  <data name="WebPartZoneTitle_Body" xml:space="preserve">
    <value>Body</value>
  </data>

 <data name="WebPartZoneTitle_Dynamic" xml:space="preserve">
    <value>Dynamic Content</value>
  </data>


Or, if you prefer a tabular view:

Name Value
WebPartZoneTitle_Body Body
WebPartZoneTitle_Bottom Bottom Zone
WebPartZoneTitle_BottomCenter Bottom Center
WebPartZoneTitle_BottomLeft Bottom Left Zone
WebPartZoneTitle_BottomRight Bottom Right Zone
WebPartZoneTitle_Center Center
WebPartZoneTitle_CenterLeft Center Left
WebPartZoneTitle_CenterRight Center Right
WebPartZoneTitle_Dynamic Dynamic Content
WebPartZoneTitle_Footer Footer
WebPartZoneTitle_Header Header
WebPartZoneTitle_Left Left
WebPartZoneTitle_LeftColumn Left Column
WebPartZoneTitle_MiddleLeft Middle Left Zone
WebPartZoneTitle_MiddleRight Middle Right Zone
WebPartZoneTitle_Right Right
WebPartZoneTitle_RightColumn Right Column
WebPartZoneTitle_Top Top
WebPartZoneTitle_TopLeft Top Left
WebPartZoneTitle_TopRight Top Right

While it would be possible to create more of these in this file, probably the easiest way to have a nice looking Title for the Web Part Zone would be to simply write the Title in-line (eg. replace Title="<%$Resources:cms,WebPartZoneTitle_TopLeft%>" with Title="My Special Zone")

HTH. :)

1 comment:

  1. Now it is possible to select one of the choices above from drop-down list
    http://docs.subpointsolutions.com/wp-content/uploads/2015/03/webparttitle.gif

    Thanks for great article. I include it into reSP ReSharper plugin.
    http://docs.subpointsolutions.com/resp/

    ReplyDelete