(Obsolete) Content Picker

    Alias: Umbraco.ContentPicker

    Returns: Node Id

    The content picker opens a panel to pick a specific page from the content structure. The value saved is the selected nodes ID.

    Data Type Definition Example

    Content Picker Data Type Definition

    Content Example

    Content Picker Content

    MVC View Example - value converters enabled

    Typed Example:

    @{
        IPublishedContent typedContentPicker = Model.Content.GetPropertyValue<IPublishedContent>("contentPicker");
        if (typedContentPicker != null)
        {
            <p>@typedContentPicker.Name</p>                                                
        } 
    }
    

    MVC View Example - value converters disabled

    Typed:

    @{
      if (Model.Content.HasValue("contentPicker")){
        var node = Umbraco.TypedContent(Model.Content.GetPropertyValue<int>("contentPicker"));
        <a href="@node.Url">@node.Name</a>
      }
    }
    

    Dynamic:

    @{
      if (CurrentPage.HasValue("contentPicker")){
        var node = Umbraco.Content(CurrentPage.contentPicker);
        <a href="@node.Url">@node.Name</a>
      }
    }