Question: How do I determine programmatically if my Sitecore renderings field inherits from standard value?

I can get my standard values for the rendering field with this...

```
var ss = StandardValuesManager.GetStandardValue(rootrenderingfield);

```

I can also parse the id of the rendering from this but really need to know inheritance so I can execute a rendering reference removal...

Answer: 
You can use the code below to check if it came from Standard Value or not.

```
Sitecore.Data.Fields.Field title = item.Fields["title"];
title.ContainsStandardValue(); //boolean

```

Or if you want to check the the value from the standardValue of the title field

```
title.GetStandardValue(); //string

```
I'm not sure exactly what you're looking for to do, but a layouts is typically set on standard values and then a layout delta is applied when changing the layout on a content item. Therefore this is a bit different compared to other field where the value is simply overwritten.

I guess you're looking for somethink like item.Fields[FieldIDs.Layout].GetValue(false,false). It will return null if there is no value set on the local item, i.e. it's inherited from standard values (or default). This will also apply to clones etc. It also applies to any field - not just the layout field. 

Be careful when using item.Fields[].HasValue, because it has a bug in some versions of Sitecore, making the default behaviour of returning field values incorrect. Check if GetValue(false,false) returns null instead.

Some versions of Sitecore may also put an empty "" tag in the layouts field, so your code could possibly look something like this in order to catch the scenarios I'm aware of:

```
var layoutDelta = item.Fields[FieldIDs.LayoutField].GetValue(false,false);
if (string.IsNullOrWhiteSpace(layoutDelta) || string.Equals(layoutDelta, "<r />", StringComparison.InvariantCulture)) {
    // Item is using standard or default rendering, or has none.
}

```

/ Mikael