SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm really not a Designer, but unfortunately, I have to design something. Any help will be much appreciated.

The Scenario:

I have a Page Layout with my own Content Type.

One of the Fields in the Content type is called "ArticleLink".

When editing the Page Layout, I've added thte ArticleLink in a Edit mode panel which works fine.

Now, I need to set a Attribute of a HTML Element to the value in the Articlelink column..

In other words, it has to look something like this:

<embed id="" src="<%$Resources:wss,Mycustomfield%>" width="500" height="375">

I know I can do it with Jquery/Javascript, but is there a proper way of doing it?


share|improve this question
up vote 4 down vote accepted

Its an interesting question, and there are a few approaches, these are the ones that I would look at would be.

Write your own control which reads in your custom field value and spits out the embed html tag. You could then embed the control on the page in the following manner

<SharePoint:FieldValueEmbedElement ID="id" runat="server" FieldValue="ArticleLink"/>

This control could then read in the FieldValue property from SPContext.Current.ListItem["ArticleLink"]

Another approach would be to write an Expression Builder (see the following articles for more infomation:- - MSDN Article ( - Blog Article from Keir Gordon (

This would allow you to go:-

<embed id="" src="<% $SPListItemFieldValue:ArticleLink%>" width="500" height="375">

I think the second approach would be better and would be reusable.

Regards Simon

share|improve this answer
Thanks Simon. I think the first option is the best for me. I forgot that I have the ability to do a SPContext.Current.ListItem["ArticleLink"]. Thanks again – Fox Aug 11 '11 at 13:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.