Displaying Site Columns Fields On Published Page
Hi guys,
title is prob quite confusing, basically i wanted to add meta data fields to my website, i have created the site columns in the page layout etc and they now show in the edit page via browser, but how do i get them to be displayed with their content on the
final page? do i need to add somthing to the masterpage ?
cheeers
Connect your Xcelsius dashboard to live data using Flynet Xcelsius Server - http://www.flynetviewer.com
November 9th, 2010 7:23am
Short answer is that you need to add them to your page layout itself. This article is a reasonble start to learn more about this:
http://office.microsoft.com/en-us/sharepoint-designer-help/create-a-publishing-page-layout-HA010174128.aspx
This search finds a lot of useful results:
http://www.bing.com/search?q=page+layouts+sharepoint&src=IE-SearchBox&FORM=IE8SRC
--Paul Galvin, Computer Generated Solutions (CGS)
Microsoft MVP - SharePoint
Blogging @ http://www.mstechblogs.com/paul
Twitter @ http://www.twitter.com/pagalvin
Free Windows Admin Tool Kit Click here and download it now
November 9th, 2010 7:45am
Short answer is that you need to add them to your page layout itself. This article is a reasonble start to learn more about this:
http://office.microsoft.com/en-us/sharepoint-designer-help/create-a-publishing-page-layout-HA010174128.aspx
This search finds a lot of useful results:
http://www.bing.com/search?q=page+layouts+sharepoint&src=IE-SearchBox&FORM=IE8SRC
--Paul Galvin, Computer Generated Solutions (CGS)
Microsoft MVP - SharePoint
Blogging @ http://www.mstechblogs.com/paul
Twitter @ http://www.twitter.com/pagalvin
Hi Paul, thanks for your short answer i have read that document and im still having issues, basically il try to explain once again... maybe you could help me personally?
i have added the colum fields to the page layout under the "Edit Mode Panel" and saved the article, but what do i need to add to the mastermage in order for content of these fields to be displayed in the final source of the published page.
by the way these are <meta> tag fields i am trying to implement.
would really apreciate some more help and advice.
thanks againConnect your Xcelsius dashboard to live data using Flynet Xcelsius Server - http://www.flynetviewer.com
November 9th, 2010 8:41am
hello
in order to display field value on the final page you need to add
FieldValue control on the page layout of your publishing page like this:
<%@ Register Tagprefix="spwc" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
...
<spwc:FieldValue FieldName="Title" runat="server"/>
Blog - http://sadomovalex.blogspot.com
CAML via C# - http://camlex.codeplex.com
Graphs visualization in Sharepoint - http://spgraphviz.codeplex.com
Free Windows Admin Tool Kit Click here and download it now
November 9th, 2010 9:46am
this is my code...
<%@Master language="C#"%>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>
<HTML dir="<%$Resources:wss,multipages_direction_dir_value%>" runat="server" xmlns:o="urn:schemas-microsoft-com:office:office" __expr-val-dir="ltr">
<HEAD runat="server">
<META Name="GENERATOR" Content="Microsoft SharePoint">
<META Name="progid" Content="SharePoint.WebPartPage.Document">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<META HTTP-EQUIV="Expires" content="0">
<SharePoint:RobotsMetaTag runat="server"/>
<Title ID=onetidTitle><asp:ContentPlaceHolder id=PlaceHolderPageTitle runat="server"/></Title>
<SharePoint:CssLink runat="server"/>
<SharePoint:Theme runat="server"/>
<SharePoint:ScriptLink language="javascript" name="core.js" Defer="true" runat="server"/>
<SharePoint:CustomJSUrl runat="server"/>
<SharePoint:SoapDiscoveryLink runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/>
<SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>
</HEAD>
and i want my new field columns from the pagelayout to be shown also as <Meta> tags in this head column....
so your saying i should just addd what you suggested to this area?Connect your Xcelsius dashboard to live data using Flynet Xcelsius Server - http://www.flynetviewer.com
November 9th, 2010 10:23am
code is useful because in context of Sharepoint term "meta" may have several meanings. So one of the solution is the following:
1. add id attribute into your meta tag in layout and runat="server":
<META Name="mymeta" id="mymeta" runat="server" >
After this you will have System.Web.UI.HtmlControls.HtmlMeta mymeta; control available in the codebehind of your page. And you can set Content property of this control like this:
protected override void OnLoad(EventArgs e)
{
this.mymeta.Content = SPContext.Current.ListItem["Title"];
}
The problem is that in your case this is page layout and no code behind available. But you can insert server side script into your page like this:
<script language="C#" runat="server">
protected override void OnLoad(EventArgs e)
{
this.mymeta.Content = SPContext.Current.ListItem["Title"];
}
</script>
Hope it will helpBlog - http://sadomovalex.blogspot.com
CAML via C# - http://camlex.codeplex.com
Graphs visualization in Sharepoint - http://spgraphviz.codeplex.com
Free Windows Admin Tool Kit Click here and download it now
November 9th, 2010 11:23am
thanks for a detailed reply but from what i can see it dosent seem necasary...
this is the soloution i am trying to implement... and it mentions none of this.
http://www.mtelligent.com/journal/2008/1/11/using-the-delegate-control-to-add-meta-tags-to-sharepoint-pa.html
any chance someone could look at that link and help me through this step by step.
would be very very gratefull.
i have a feeling ive missed somthing very very small.
thanksConnect your Xcelsius dashboard to live data using Flynet Xcelsius Server - http://www.flynetviewer.com
November 9th, 2010 11:45am