Set a manual order when created some contents


#1

Enonic version: 6.15.5
OS: Windows 10

I have an import in a task (external API), and I need to create the items in the folder and sort by the order that they come. I don’t use the createdTime ASC because this import can include new objects and modify others (the new objects always have a newer date).
Is there any way to import this and use the manual order when I create the content?


#2

I don’t see why you cannot use a createdTime, as long as this value does not change when you modify?
Are you using node or content api?


#3

Because the imported contents are changed in some imports. This is an example:

  1. In first call of API I get this data: A, B, C, D.
  2. After time I call API and get this data: E, B, C, D. The content B, C and D are modified and theirs createdTime not changed. The content E is created and have a newest createdTime. The sort in createdTime order is this: B, C, D, E. And this sort is wrongly.

#4

What api are you referring to here?


#5

This is an external API that return a JSON.


#6

If I understand you correctly, by setting a property in XP i.e. “created” to current time of import, and avoid updating this when modifying items, you can always sort on this property to get the items in the ordner they were created in XP.