<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Sort data by descending date in freemarker template</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119757136" />
  <subtitle>Sort data by descending date in freemarker template</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119757136</id>
  <updated>2026-04-04T16:00:54Z</updated>
  <dc:date>2026-04-04T16:00:54Z</dc:date>
  <entry>
    <title>RE: Sort data by descending date in freemarker template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119789397" />
    <author>
      <name>sanket jani</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119789397</id>
    <updated>2020-08-18T12:04:55Z</updated>
    <published>2020-08-18T12:04:55Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Christoph Rabel:&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;How about: (I have added &amp;#34;?reverse&amp;#34;)&lt;br /&gt; &amp;lt;#list NewsTitle.getSiblings()?sort_by([&amp;#34;NewsDate&amp;#34;,&amp;#34;data&amp;#34;])?reverse as cur_NewsTitle&amp;gt; &lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Hello Christoph , your solution worked . Thank you for your help !!!!!</summary>
    <dc:creator>sanket jani</dc:creator>
    <dc:date>2020-08-18T12:04:55Z</dc:date>
  </entry>
  <entry>
    <title>RE: Sort data by descending date in freemarker template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119765770" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119765770</id>
    <updated>2020-08-15T08:42:59Z</updated>
    <published>2020-08-15T08:42:59Z</published>
    <summary type="html">How about: (I have added &amp;#34;?reverse&amp;#34;)&lt;br /&gt; &amp;lt;#list NewsTitle.getSiblings()?sort_by([&amp;#34;NewsDate&amp;#34;,&amp;#34;data&amp;#34;])?reverse as cur_NewsTitle&amp;gt; </summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2020-08-15T08:42:59Z</dc:date>
  </entry>
  <entry>
    <title>Sort data by descending date in freemarker template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119757135" />
    <author>
      <name>sanket jani</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119757135</id>
    <updated>2020-08-13T11:10:09Z</updated>
    <published>2020-08-13T11:10:09Z</published>
    <summary type="html">Hello Team , I am creating one web content used to show latest news . I have created structure and template for the same also able to sort it by date but problem is its showing latest date at bottom i want to show latest news at top. Kindly help me to resolve this problem .&lt;br /&gt;To sort the data i am using below line    &amp;lt;#list NewsTitle.getSiblings()?sort_by([&amp;#34;NewsDate&amp;#34;,&amp;#34;data&amp;#34;]) as cur_NewsTitle&amp;gt; &lt;br /&gt;NewsDate is the date field in structure.&lt;br /&gt;Here is the attachment for the work 1.png - structure screenshot2.png - final look of web content on pagestructure - structure sourcefreemarker - template to render the web content</summary>
    <dc:creator>sanket jani</dc:creator>
    <dc:date>2020-08-13T11:10:09Z</dc:date>
  </entry>
</feed>
