Article Sort by SortOrder is not working on normal page

Former Member
Former Member

Hi,

Below mentioned code is working for "https://commdev.dynamics-int.com/usergroup/a/usergroup/c/faq" but It is not working on my custom page "https://commdev.dynamics-int.com/usergroup/p/contact-msft". Please provide me some solution to arrange the sorting as per article listing page.

#set($sortBy = 'SortOrder')
#set($sortOrder = 'Ascending')
#set($pageSize = 25)
#set($pageIndex = 1)
#set ($query = "%{ PageSize = $pageSize, PageIndex = $pageIndex }")

$query.Add('ArticleCollectionId', $collection.Id)
$query.Add('SortBy', $sortBy)
$query.Add('SortOrder', $sortOrder)

#set($posts = false)
#set($posts = $articles_v1_articles.List($query))
$posts.TotalCount

Thanks,

Sudhanshu

Parents Reply
  • Hi Patrick,

    All the articles are published in a particular category and the collection id is correct.

    The issue here is:

    Working Scenario: While using API $articles_v1_articles.List($query) and passing 'SortBy="PublishDate"', it is returning all 4 articles of category.

    Current NonWorking Scenario: While using API $articles_v1_articles.List($query) and passing 'SortBy="SortOrder"', it is returning 0 articles of category.

    Since we are using the later scenario in a custom widget on a custom URL so it is not working. So, have we imposed some restriction for the same ?

Children