This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomFeedProvider : IFeedProvider | |
{ | |
public IEnumerable<IFeedItem> LoadItems(IFeed feedToLoad) | |
{ | |
return feedToLoad.LoadItems(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomFeed : IFeed | |
{ | |
public string EditViewFriendlyTitle { get { return "Friendly title"; } } | |
public bool AvailableInEditView { get { return true; } } | |
public IEnumerable<IFeedItem> LoadItems() | |
{ | |
var selectItems = new List<IFeedItem>(); | |
selectItems.Add(new FeedItem { Key = "Foo", Value = "1" }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[UIDescriptorRegistration] | |
public class ArticlePageDescriptor : UIDescriptor<ArticlePage>, IEditorDropBehavior | |
{ | |
public EditorDropBehavior EditorDropBehaviour { get; set; } | |
public ArticlePageDescriptor() | |
{ | |
EditorDropBehaviour = EditorDropBehavior.CreateContentBlock; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CatalogContentType(GUID = "64ED6E28-07B1-4F18-A075-046D1557EFFE")] | |
public class Product : ProductContent, IResourceable | |
{ | |
public virtual string ContentAssetIdInternal { get; set; } | |
public Guid ContentAssetsID | |
{ | |
get | |
{ | |
Guid assetId; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private readonly IContentRepository _contentRepo = ServiceLocator.Current.GetInstance<IContentRepository>(); | |
private readonly ContentAssetHelper _contentAssetHelper = ServiceLocator.Current.GetInstance<ContentAssetHelper>(); | |
Product product = _contentRepo.Get<Product>(new ContentReference(123)); | |
ContentAssetFolder assetFolder = _contentAssetHelper.GetOrCreateAssetFolder(product.ContentLink); | |
Review newReview = _contentRepo.GetDefault<Review>(assetFolder.ContentLink); | |
newReview.Rating = 5; | |
newReview.Text = "This is such a nice product"; | |
newReview.UserDisplayName = "Arve Systad"; | |
newReview.Name = newReview.UserDisplayName + "(" + DateTime.Now.ToShortDateString() + ")"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Component] | |
public class ReviewPaneNavigationComponent : ComponentDefinitionBase | |
{ | |
public ReviewPaneNavigationComponent() : base("epi-cms.component.SharedBlocks") | |
{ | |
PlugInAreas = new[] { "/episerver/cms/assets/defaultgroup", "/episerver/commerce/assets/defaultgroup" }; | |
Categories = new[] { "commerce", "cms","content" }; | |
LanguagePath = "/components/review"; | |
SortOrder = 11090; | |
Settings.Add(new Setting("repositoryKey", ReviewPaneDescriptor.RepositoryKey)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ServiceConfiguration(typeof(IContentRepositoryDescriptor))] | |
public class ReviewPaneDescriptor : ContentRepositoryDescriptorBase | |
{ | |
public static string RepositoryKey { get { return "reviews"; } } | |
public override string Key { get { return RepositoryKey; } } | |
public override string Name { get { return "Product reviews"; } } | |
public override IEnumerable<Type> ContainedTypes | |
{ | |
get { return new [] { typeof(Review), typeof(ContentFolder) }; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ContentType(GUID = "6CA27C21-FF6C-425F-A87D-1C7E4BE26AA8", AvailableInEditMode = true)] | |
public class Review : ContentData, IContent | |
{ | |
public virtual int Rating { get; set; } | |
public virtual string ProductNumber { get; set; } | |
[BackingType(typeof(PropertyLongString))] | |
public virtual string Text { get; set; } | |
public virtual string UserDisplayName { get; set; } | |
//IContent implementation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Display] | |
[UIHint("MyUIHint")] | |
public virtual XhtmlString SexyTextArea { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[EditorDescriptorRegistration(TargetType = typeof(XhtmlString), UIHint = "MyUIHint")] | |
public class MyEditorDescriptor : XhtmlStringEditorDescriptor | |
{ | |
public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable<Attribute> attributes) | |
{ | |
base.ModifyMetadata(metadata, attributes); | |
KeyValuePair<string, object> tinyMceSettings = metadata.EditorConfiguration.FirstOrDefault(x => x.Key == "settings"); | |
var dictionary = tinyMceSettings.Value as Dictionary<string,object>; | |
if (dictionary != null) |