<?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>How to set the web content display portlet to show the latest version ?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112938545" />
  <subtitle>How to set the web content display portlet to show the latest version ?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112938545</id>
  <updated>2026-04-04T08:49:15Z</updated>
  <dc:date>2026-04-04T08:49:15Z</dc:date>
  <entry>
    <title>RE: How to set the web content display portlet to show the latest version ?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113066839" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113066839</id>
    <updated>2019-04-08T14:37:57Z</updated>
    <published>2019-04-08T14:37:57Z</published>
    <summary type="html">No problem -- if they approve it and you guys end up putting it into action, I would also suggest maybe circling back to this thread and sharing your template code, or maybe writing a blog post for anyone else that might be after the same type of solution. Best of luck.</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2019-04-08T14:37:57Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to set the web content display portlet to show the latest version ?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113066168" />
    <author>
      <name>Vishnu S Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113066168</id>
    <updated>2019-04-08T14:31:37Z</updated>
    <published>2019-04-08T14:31:37Z</published>
    <summary type="html">&lt;blockquote&gt;Christoph RabelMaybe it is simpler to just hook the view jsp of the webcontent display:&lt;br /&gt;https://github.com/liferay/liferay-portal/blob/master/modules/apps/journal/journal-content-web/src/main/resources/META-INF/resources/view.jsp&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Thank You Christoph!</summary>
    <dc:creator>Vishnu S Kumar</dc:creator>
    <dc:date>2019-04-08T14:31:37Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to set the web content display portlet to show the latest version ?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113065836" />
    <author>
      <name>Vishnu S Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113065836</id>
    <updated>2019-04-08T14:30:50Z</updated>
    <published>2019-04-08T14:30:50Z</published>
    <summary type="html">&lt;blockquote&gt;Andrew JardineVishnu,&lt;br /&gt;&lt;br /&gt;I think he was suggesting using the roles to allow for preview, but I&amp;#39;m not sure that will provide the in context approach that I think you are after. I have an alternative suggestion that would work with all out of the box stuff, but might not be the most awesome solution.&lt;br /&gt;&lt;br /&gt;Instead of using the web content display, use an Asset Publisher, where you specify the item you want to render (don&amp;#39;t do the dynamic option, use the other one .. the name of which escapes me). Then, in your ADT, you can use the JournalArticleLocalService to see if there is a newer (unapporved) version and if there is, and the user has the right role to view it, then render the unapproved version in place of the approved one.&lt;br /&gt;&lt;br /&gt;The ADT wouldn&amp;#39;t contain any of the &amp;#34;template view&amp;#34; in it, just the logic for the decision of which version to render. Actually, come to think of it, you don&amp;#39;t need the Asset Publisher/ADT -- you could introduce the logic into you WCM template in the same fashion &lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" &gt;&lt;br /&gt;&lt;br /&gt;I nice solution might be to try this --&lt;br /&gt;&lt;br /&gt;1. In your WCM, detect if the user has the rights to see unapproved content. &lt;br /&gt;2. If they do, give them a toggle to &amp;#34;preview unpublished&amp;#34;&lt;br /&gt;3. By default you render the approved but if they hit that toggle, you re-render with the unapproved one&lt;br /&gt;&lt;br /&gt;.. anyway, you can do it by introducing some logic into your template. Not the best practice mind you as templates shouldn&amp;#39;t really be &amp;#34;smart&amp;#34;, but if you have no other choise, I think that would work.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Thank you Andrew. This seems to be an excellent solution. We&amp;#39;ll bring it up to the business to get their feedback.&lt;br /&gt;&lt;br /&gt;Regards!</summary>
    <dc:creator>Vishnu S Kumar</dc:creator>
    <dc:date>2019-04-08T14:30:50Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to set the web content display portlet to show the latest version ?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113065498" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113065498</id>
    <updated>2019-04-08T14:23:52Z</updated>
    <published>2019-04-08T14:23:52Z</published>
    <summary type="html">Maybe it is simpler to just hook the view jsp of the webcontent display:&lt;br /&gt;https://github.com/liferay/liferay-portal/blob/master/modules/apps/journal/journal-content-web/src/main/resources/META-INF/resources/view.jsp</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2019-04-08T14:23:52Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to set the web content display portlet to show the latest version ?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113065025" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113065025</id>
    <updated>2019-04-08T14:19:46Z</updated>
    <published>2019-04-08T14:19:46Z</published>
    <summary type="html">Vishnu,&lt;br /&gt;&lt;br /&gt;I think he was suggesting using the roles to allow for preview, but I&amp;#39;m not sure that will provide the in context approach that I think you are after. I have an alternative suggestion that would work with all out of the box stuff, but might not be the most awesome solution.&lt;br /&gt;&lt;br /&gt;Instead of using the web content display, use an Asset Publisher, where you specify the item you want to render (don&amp;#39;t do the dynamic option, use the other one .. the name of which escapes me). Then, in your ADT, you can use the JournalArticleLocalService to see if there is a newer (unapporved) version and if there is, and the user has the right role to view it, then render the unapproved version in place of the approved one.&lt;br /&gt;&lt;br /&gt;The ADT wouldn&amp;#39;t contain any of the &amp;#34;template view&amp;#34; in it, just the logic for the decision of which version to render. Actually, come to think of it, you don&amp;#39;t need the Asset Publisher/ADT -- you could introduce the logic into you WCM template in the same fashion &lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" &gt;&lt;br /&gt;&lt;br /&gt;I nice solution might be to try this --&lt;br /&gt;&lt;br /&gt;1. In your WCM, detect if the user has the rights to see unapproved content. &lt;br /&gt;2. If they do, give them a toggle to &amp;#34;preview unpublished&amp;#34;&lt;br /&gt;3. By default you render the approved but if they hit that toggle, you re-render with the unapproved one&lt;br /&gt;&lt;br /&gt;.. anyway, you can do it by introducing some logic into your template. Not the best practice mind you as templates shouldn&amp;#39;t really be &amp;#34;smart&amp;#34;, but if you have no other choise, I think that would work.</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2019-04-08T14:19:46Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to set the web content display portlet to show the latest version ?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113062383" />
    <author>
      <name>Vishnu S Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113062383</id>
    <updated>2019-04-08T13:58:19Z</updated>
    <published>2019-04-08T13:58:19Z</published>
    <summary type="html">Thanks for the response.&lt;br /&gt;&lt;br /&gt;We have had already considered and dropped the solutions 2 &amp;amp; 3. The problem with solution 2 is that the content management team doesn&amp;#39;t like a custom portlet, as they are comfortable with OOB portlet especially it&amp;#39;s drag and drop feature of the content on a page. Solution 3 as you said we also don&amp;#39;t recommend.&lt;br /&gt;&lt;br /&gt;The solution 1,  I don&amp;#39;t understand clearly could you please explain that? Also we only want our admin users to see the latest version the public users should&amp;#39;t see that. Also the latest content may not have published any single time so it won&amp;#39;t even appear on the web content display portlet we need to change this too. The whole idea behind this is  to allow admin users to verify a content on a page before it goes to the customers.&lt;br /&gt;&lt;br /&gt;Cheers!</summary>
    <dc:creator>Vishnu S Kumar</dc:creator>
    <dc:date>2019-04-08T13:58:19Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to set the web content display portlet to show the latest version ?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112941652" />
    <author>
      <name>Gnaniyar Zubair</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112941652</id>
    <updated>2019-03-31T08:21:19Z</updated>
    <published>2019-03-31T08:21:19Z</published>
    <summary type="html">The Web content display portlet will show the latest approved article by default. if your client wants to achieve the behavious as you mentioned, here is the different approach&lt;br /&gt;&lt;br /&gt;1. Control Panel  : Assign Web Content Admin role to the user and admin user can go to control panel web content portlet and can view all the history of articles ( versions / status)&lt;br /&gt;&lt;br /&gt;2. Custom Portlet:  Create Custom Portlet and display all the contents irrespective of versions or status using Journal API for the Particular Role. &lt;br /&gt;&lt;br /&gt;3.  Web Content Hook : (Not Recommended) if client doesn&amp;#39;t satisfy for the above approaches and he wants to the same behaviour in OOTB portlet then you can customize existing beheviour thorugh MVCActionCommand / MVCRenderCommand or jsp hook to achieve this.&lt;br /&gt;&lt;br /&gt;​​​​​​​HTH.</summary>
    <dc:creator>Gnaniyar Zubair</dc:creator>
    <dc:date>2019-03-31T08:21:19Z</dc:date>
  </entry>
  <entry>
    <title>How to set the web content display portlet to show the latest version ?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112938544" />
    <author>
      <name>Vishnu S Kumar</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112938544</id>
    <updated>2019-03-29T14:18:08Z</updated>
    <published>2019-03-29T14:18:08Z</published>
    <summary type="html">The web content display portlet displays the&lt;strong&gt; latest approved &lt;/strong&gt;vesion of a web content. Our client needs to see the latest version (approved / unapproved) on the actual page before approving and opening to the end users. &lt;br /&gt;&lt;br /&gt;for example: if latest approved version is 1.2 then the business would like to see version 1.3 on the page which can be on any other status(pending,draft,schduled etc).&lt;br /&gt;&lt;br /&gt;How to implement this?&lt;br /&gt;&lt;br /&gt;Regards!</summary>
    <dc:creator>Vishnu S Kumar</dc:creator>
    <dc:date>2019-03-29T14:18:08Z</dc:date>
  </entry>
</feed>
