Skip to content

Instantly share code, notes, and snippets.

@jonihietala
Last active October 22, 2017 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonihietala/bd945c46e723ff20e51f08daa92936a3 to your computer and use it in GitHub Desktop.
Save jonihietala/bd945c46e723ff20e51f08daa92936a3 to your computer and use it in GitHub Desktop.
public abstract class SitePageData : PageData, ICustomCssInContentArea, ICarouselContent
{
// ...
[Display(GroupName = "CarouselContent", Order = 10)]
[CultureSpecific]
[UIHint(UIHint.Image)]
public virtual Url Image { get; set; }
[Display(GroupName = "CarouselContent", Order = 20)]
[CultureSpecific]
public virtual string ImageDescription
{
get
{
var propertyValue = this["ImageDescription"] as string;
return string.IsNullOrWhiteSpace(propertyValue) ? Heading : propertyValue;
}
set { this["ImageDescription"] = value; }
}
[Display(GroupName = "CarouselContent", Order = 30)]
[CultureSpecific]
public virtual string Heading { get; set; }
[Display(GroupName = "CarouselContent", Order = 40)]
[CultureSpecific]
[UIHint(UIHint.Textarea)]
public virtual string SubHeading { get; set; }
[Display(GroupName = "CarouselContent", Order = 50)]
[CultureSpecific]
public virtual string ButtonText { get; set; }
[Display(GroupName = "CarouselContent", Order = 60)]
[CultureSpecific]
public virtual Url ButtonLink { get; set; }
[Ignore]
public bool Selected { get; set; }
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment