0

We are using PageTypeBuilder to define our PageTypes, on one page we have a property which represents a Link item collection as below:

[PageTypeProperty(Type = typeof(PropertyLinkCollection), HelpText = "Test links.", EditCaption = "Test links", SortOrder = 11)]
        public virtual LinkItemCollection PageLinks { get; set; }

We can populate this in CMS editor mode with links, save and publish without any errors. We then have a user control that inherits from EPiServer.UserControlBase and grabs the LinkItemCollection property using the below code and binds it to a repeater:

var links = currentPage.Property["PageLinks"].Value as LinkItemCollection;
if (links != null)
{
    linkRepeater.DataSource = links;
    linkRepeater.DataBind();
}

If I view the page when logged in as a CMS editor this page works fine and the links parameter is populated correctly, however if I view the page as a normal user and not logged in the links variable is always null (although when I'm debugging I can see the currentPage.Property["PageLinks"] is present, and the type is LinkCollection, its just that the Value is null

Is there something I need to configure here, permissions on a specific page type?

4

1 回答 1

1

问题很可能是外部访问者无法访问 LinkItemCollection 中的页面之一。尝试以外部访问者的身份访问集合中的链接,并删除实际上从外部视图中锁定的任何链接。

于 2012-10-01T13:35:34.523 回答