Developer forum

Forum » Templates » ItemPublisher sorting not working correctly?

ItemPublisher sorting not working correctly?

Mikkel Toustrup Olsen
Reply

Hello,

I am working on a 8.4.1.12 solution on which I have multiple items and therefore multipleItemPublishers.

I have stumpled upon a very annoying issue. My Items are sorted in the backend (by dragging and dropping them in the right order) -> even though I've selected the sort method: Sort by Sort Value (as I reckon is the option to go with) it does not render the items in the correct order at all.

I have tried using LINQ as well, however I cannot get it to work - I can't find any documentation on how to query the list like:

foreach(var item i in GetLoop("ItemPublisher:Items.List").OrderBy("Sort Value", OrderByDirection.Ascending)...

can you guys give me any hints on how to accomplish this?

Regards,

MikkelTO


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Mikkel

It works perfect on my solution. Be aware of the bug 15010 - but it should have no significant impact.

http://developer.dynamicweb.com/releases/dynamicweb-8-5/bug-fixes-8-5.aspx#item15010

If you have a structure like this and you publish all of them, of course they will be mixed since both Sub item 1 have sort 1.

Page

  1. Sub item 1
  2. Sub item 2
  3. Sub item 3

Page

  1. Sub item 1
  2. Sub item 2
  3. Sub item 3

Are you using page based or paragraph based items?

And do you have a link?

Nicolai

 
Mikkel Toustrup Olsen
Reply

Hey Nicolai,

I am using paragraph based items.

http://danishagro.ditnyewebsite.dk/Default.aspx?ID=744&Purge=True

Seems to work when sorting on e.g. name - alphabetical, however by sorting value it does not, unfortunately. I would love to have some LINQ workaround if possible.

/MikkelTO

 
Nicolai Høeg Pedersen
Reply

Hi Mikkel

I see the issue. I tried to reproduce on my 8.5 and it works there. So I think the bug TFS#15010 fixes this issue. The issue is not fixable using a linq because the sort value is not in the item collection - that is the entire problem that was fixed. So an upgrade is required...

BR Nicolai

 
Mikkel Toustrup Olsen
Reply

Regarding the update, what version would you recommend. Just the latest recommended version or the 8.5?..

 

 
Mikkel Toustrup Olsen
Reply

Regarding the update, what version would you recommend. Just the latest recommended version or the 8.5?..

 

 
Nicolai Høeg Pedersen
Reply

Hi Mikkel

The newest 8.5.0.* - that would be 8.5.0.2 or 8.5.0.1.

 
Mikkel Toustrup Olsen
Reply

Okay, thanks - I will give that a shot :)

 

 

You must be logged in to post in the forum