// zones public static Builder <AvailableZoneAttribute> AvailableZone <TModel>(this IContentRegistration <TModel> registration, string zoneName, string title = null) { return(registration.RegisterRefiner(new AvailableZoneAttribute(title ?? zoneName, zoneName))); }
/// <summary> /// Class applicable editable attribute that adds text boxes for selecting /// published date range. /// </summary> public static EditableBuilder <WithEditablePublishedRangeAttribute> PublishedRange <T>(this IContentRegistration <T> registration, string title = "Published between") { return(registration.RegisterEditable <WithEditablePublishedRangeAttribute>("Published", title)); }
/// <summary> /// This attribute replace the children allowed with the types /// </summary> public static Builder <RestrictChildrenAttribute> RestrictChildren <TModel>(this IContentRegistration <TModel> registration, params Type[] allowedChildTypes) { return(registration.RegisterRefiner <RestrictChildrenAttribute>(new RestrictChildrenAttribute(allowedChildTypes))); }
/// <summary> /// Places a container in the right-hand side of the editing UI. /// </summary> public static ContainerBuilder <TModel, SidebarContainerAttribute> SidebarContainer <TModel>(this IContentRegistration <TModel> display, string containerName, string headingText, Action <IContentRegistration <TModel> > containerRegistration = null) { return(display.Register(new SidebarContainerAttribute(containerName, 0) { HeadingText = headingText }) .Do(containerRegistration)); }
/// <summary>Begins registration of a property on the content type.</summary> /// <typeparam name="TProperty">The property type of the property.</typeparam> /// <param name="expression">An expression defining the property, e.g. item => item.Text</param> /// <returns>A property registration object.</returns> public static PropertyRegistration <TModel, TProperty> On <TModel, TProperty>(this IContentRegistration <TModel> registration, Expression <Func <TModel, TProperty> > expression) { string expressionText = System.Web.Mvc.ExpressionHelper.GetExpressionText(expression); return(new PropertyRegistration <TModel, TProperty>(registration, expressionText)); }
public static EditableBuilder <EditableMultipleItemSelectionAttribute> MultipleItemSelection(this IContentRegistration registration, string name, Type linkedType, Type excludedType = null) { return(registration.RegisterEditable(new EditableMultipleItemSelectionAttribute { LinkedType = linkedType, ExcludedType = excludedType ?? typeof(ISystemNode), Title = name, Name = name })); }
/// <summary> /// Defines a tab panel that can be used to contain editor controls. /// </summary> public static ContainerBuilder <TModel, TabContainerAttribute> TabContainer <TModel>(this IContentRegistration <TModel> registration, string containerName, string tabText, Action <IContentRegistration <TModel> > containerRegistration = null) { return(registration.Register(new TabContainerAttribute(containerName, tabText ?? containerName, 0)) .Do(containerRegistration)); }
public static EditableBuilder <EditableUserControlAttribute> UserControl(this IContentRegistration registration, string name, string userControlPath, string title = null) { return(registration.RegisterEditable <EditableUserControlAttribute>(name, title) .Configure(e => e.UserControlPath = userControlPath)); }
public static EditableBuilder <EditableSummaryAttribute> Summary(this IContentRegistration registration, string name, string title = null, string source = null) { return(registration.RegisterEditable <EditableSummaryAttribute>(name, title) .Configure(e => e.Source = source)); }
public static EditableBuilder <EditableLanguagesDropDownAttribute> Languages(this IContentRegistration registration, string name, string title = null) { return(registration.RegisterEditable <EditableLanguagesDropDownAttribute>(name, title)); }
public static EditableBuilder <EditableThemeSelectionAttribute> ThemeSelection(this IContentRegistration registration, string name, string title = null) { return(registration.RegisterEditable <EditableThemeSelectionAttribute>(name, title)); }
public static EditableBuilder <WithEditableTitleAttribute> Title(this IContentRegistration registration, string title = "Title") { return(registration.RegisterEditable <WithEditableTitleAttribute>("Title", title)); }
public static EditableBuilder <EditableFreeTextAreaAttribute> FreeText(this IContentRegistration registration, string name, string title = null) { return(registration.RegisterEditable <EditableFreeTextAreaAttribute>(name, title)); }
/// <summary>Specifies the icon to display when selecting new items to create.</summary> public static IContentRegistration <TModel> IconClass <TModel>(this IContentRegistration <TModel> registration, string iconClass) { registration.Definition.IconClass = iconClass; return(registration); }
public static EditableBuilder <EditableDateAttribute> Date(this IContentRegistration registration, string name, string title = null) { return(registration.RegisterEditable <EditableDateAttribute>(name, title)); }
public static Builder <RestrictParentsAttribute> RestrictParents(this IContentRegistration registration, params Type[] allowedParentTypes) { return(registration.RegisterRefiner(new RestrictParentsAttribute(allowedParentTypes))); }
public static EditableBuilder <EditableEnumAttribute> Enum(this IContentRegistration registration, string name, Type enumType, string title = null) { return(registration.RegisterEditable <EditableEnumAttribute>(name, title) .Configure(e => e.EnumType = enumType)); }
public static Builder <RestrictChildrenAttribute> RestrictChildren(this IContentRegistration registration, AllowedTypes allowedTypes) { return(registration.RegisterRefiner(new RestrictChildrenAttribute(allowedTypes))); }
public static EditableBuilder <EditableMultipleItemSelectionAttribute> MultipleItemSelection(this IContentRegistration registration, string name, Func <IEnumerable <ContentItem> > getContentItems) { return(registration.RegisterEditable <EditableMultipleItemSelectionAttribute>(new CustomMultipleItemSelection { Title = name, Name = name, CustomItemsGetter = () => getContentItems().Select(ci => new ListItem(ci.Title, ci.ID.ToString(CultureInfo.InvariantCulture))) })); }
public static Builder <AllowedZonesAttribute> AllowedZones(this IContentRegistration registration, params string[] zoneNames) { return(registration.RegisterRefiner(new AllowedZonesAttribute(zoneNames))); }
/// <summary> /// Organizes editors in a field set that can be expanded to show all details. /// </summary> public static ContainerBuilder <TModel, ExpandableContainerAttribute> ExpandableContainer <TModel>(this IContentRegistration <TModel> display, string containerName, string legend, Action <IContentRegistration <TModel> > containerRegistration = null) { return(display.Register(new ExpandableContainerAttribute(containerName, legend ?? containerName, 0)) .Do(containerRegistration)); }
public static EditableBuilder <EditableTagsAttribute> Tags(this IContentRegistration registration, string name) { return(registration.RegisterEditable <EditableTagsAttribute>(name, name)); }
/// <summary> /// Places contained controls in the site editor interface instead of the regular editor /// interface. Any recursive containers in the selected page and it's ancestors are displayed. /// </summary> public static ContainerBuilder <TModel, RecursiveContainerAttribute> RecursiveContainer <TModel>(this IContentRegistration <TModel> display, string containerName, string headingFormat, Action <IContentRegistration <TModel> > containerRegistration = null) { return(display.Register(new RecursiveContainerAttribute(containerName, 0) { HeadingFormat = headingFormat }) .Do(containerRegistration)); }
public static EditableBuilder <WithEditableDateRangeAttribute> DateRange(this IContentRegistration registration, string nameStart, string nameEnd, string title = "Dates") { return(registration.RegisterEditable <WithEditableDateRangeAttribute>(nameStart, title) .Configure(a => a.NameEndRange = nameEnd)); }
/// <summary>Class applicable attribute used to add a name editor. The name represents the URL slug for a certain content item.</summary> public static EditableBuilder <WithEditableNameAttribute> Name <T>(this IContentRegistration <T> registration, string title = "Name") { return(registration.RegisterEditable <WithEditableNameAttribute>("Name", title)); }
public static EditableBuilder <EditableCheckBoxAttribute> CheckBox(this IContentRegistration registration, string name, string checkBoxText = null) { return(registration.RegisterEditable <EditableCheckBoxAttribute>(name, "") .Configure(e => e.CheckBoxText = checkBoxText)); }
// restrictions /// <summary> /// A class decoration used to restrict which items may be placed under /// which. When this attribute intersects with /// <see cref="AllowedChildrenAttribute"/>, the union of these two are /// considered to be allowed.</summary> public static Builder <RestrictParentsAttribute> RestrictParents <TModel>(this IContentRegistration <TModel> registration, AllowedTypes allowedTypes) { return(registration.RegisterRefiner <RestrictParentsAttribute>(new RestrictParentsAttribute(allowedTypes))); }
public static EditableBuilder <EditableChildrenAttribute> Children(this IContentRegistration registration, string zoneName) { return(registration.RegisterEditable <EditableChildrenAttribute>(zoneName, zoneName).Configure(eca => eca.ZoneName = zoneName)); }
/// <summary>Specifies the icon to display when selecting new items to create.</summary> public static IContentRegistration <TModel> Icon <TModel>(this IContentRegistration <TModel> registration, string iconUrl) { registration.Definition.IconUrl = N2.Web.Url.ResolveTokens(iconUrl); return(registration); }
public override void RegisterDefinition(IContentRegistration <FluentWebFormPage> register) { register.Page(); register.UsingConventions(); register.Definition.SortOrder = 1000; }