Roots tells you where you can create comments. What happens if you leave it as empty IEnumerable and then add comment as you would add a local image in page files?
Thats the problem. :-)
It displays nothing if I leave it as an empty enumerable. But according to article. It should automatically show "For this page"-folder and list comments therein. I've followed the article but it does not show any content unless I set Roots to ContentAssetsFolder. But setting this is not what I want. I want it to just show the comments for the specific page I am looking at.
I'm wondering if you are creating the comments at the right place. How do you create them? Programmatically or by clicking in edit? Are you creating them in the local page files folder or in root for assets?
PageData page = _contentRepo.Get<PageData>(new ContentReference(comment.PageId)); ContentAssetFolder assetFolder = _contentAssetHelper.GetOrCreateAssetFolder(page.ContentLink); Comment save_comment = _contentRepo.GetDefault<Comment>(assetFolder.ContentLink); save_comment.UserComment = new XhtmlString(comment.Text); save_comment.CommentParentLink = (comment.ParentId.HasValue) ? new ContentReference(comment.ParentId.Value) : ContentReference.EmptyReference; save_comment.CommentUserName = EPiServerProfile.Current.UserName; save_comment.Name = "Comment_" + EPiServerProfile.Current.UserName.Replace(" ", "") + "(" + DateTime.Now.ToShortDateString() + ")"; _contentRepo.Save(save_comment, SaveAction.Publish, AccessLevel.NoAccess);
comment.PageId = ID for the page on which the comment is posted.
It places it in some folder connected to the page atleast.
If I set Roots to ;
I can browse the comments under Folder
That code looks sound. Uploading images to local page folder works as expected? They end up in "for this page folder?". Just so there isn't any configuration error...
I have no problem uploading images to "For this Page" -folder. I'm running version 9.6.1
Following this article I implemented some similar functionality.
But I don't get the comments to show up under "For this page". However, if I add I can see the comments under "For this page" -> (A folder named same as page) They are there. But they do not automagically appear as described in the article if I leave roots with an empty enumerable.
What am I missing?
Thanks in advance!