Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 711 Bytes

ContentPicker.md

File metadata and controls

31 lines (24 loc) · 711 Bytes

Content Picker

Alias: Umbraco.ContentPickerAlias

Returns: IPublishedContent

Typed Example:

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

Dynamic Example:

    @{
        if (CurrentPage.HasValue("contentPicker"))
        {
            var dynamicContentPicker = CurrentPage.contentPicker;
            <p>Name: @dynamicContentPicker.Name</p>
            <p>Title: @dynamicContentPicker.title</p>
        }                    
    }