I have started developing portlets with Liferay and I would like to show one (or more) Web-content article(s) with a specified structure.
For example, suppose I’ve a structure “A” so how can I get the last web-content article which is created using this structure?
This article explains how to get articles with a tag but not with a structure.
Thank you
The Liferay API Docs (this is for 6.1, as I don’t know what version you’re using) are your friend as is the Liferay source code.
In short you’ll want to use one of the following API methods:
These rely on knowing the ID of the structure from which your content was generated, if you don’t know what it is then you can use the following API method to get a list of all of them for your current Community:
You can also use similar methods to find Journal Articles by the JournalTemplate that they use:
Comment back if you have any questions, or if this answers your question please hit the “Accept answer” button tick! Thanks!