Skip to content
This repository has been archived by the owner on Jun 18, 2018. It is now read-only.

Commit

Permalink
Updated DetachedPublishedContent to set the SortOrder property (Relat…
Browse files Browse the repository at this point in the history
…es to PR #8)
  • Loading branch information
mattbrailsford committed Jun 25, 2015
1 parent a1b2aee commit a94e2e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ public override object ConvertDataToSource(PublishedPropertyType propertyType, o
// Do nothing, we just want to parse out the name if we can
}

processedValue.Add(new DetachedPublishedContent(nameObj == null ? null : nameObj.ToString(), publishedContentType, properties.ToArray()));
processedValue.Add(new DetachedPublishedContent(
nameObj == null ? null : nameObj.ToString(),
publishedContentType,
properties.ToArray(),
i));
}

// Detect min/max items == 1 and just return a single IPublishedContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@ internal class DetachedPublishedContent : PublishedContentBase
private readonly string _name;
private readonly PublishedContentType _contentType;
private readonly IEnumerable<IPublishedProperty> _properties;
private readonly int _sortOrder;
private readonly bool _isPreviewing;

public DetachedPublishedContent(string name,
PublishedContentType contentType,
IEnumerable<IPublishedProperty> properties,
int sortOrder = 0,
bool isPreviewing = false)
{
_name = name;
_contentType = contentType;
_properties = properties;
_sortOrder = sortOrder;
_isPreviewing = isPreviewing;
}

Expand Down Expand Up @@ -96,7 +99,7 @@ public override int TemplateId

public override int SortOrder
{
get { return 0; }
get { return _sortOrder; }
}

public override string UrlName
Expand Down

0 comments on commit a94e2e2

Please sign in to comment.