Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Total count of results in ADT of an Asset Publisher in Liferay 7
Hello,
is there a way to get the total number of results in an ADT in an Asset Publisher? For example, lets say, I want to type for every asset that it is the 3rd of the 124 total results. If I enable the pagination (20 results per page), how could I get in my freemarker ADT the number 124 (total number of results)?
Thanks in advance.
Charalampos Chrysikopoulos:is there a way to get the total number of results in an ADT in an Asset Publisher? For example, lets say, I want to type for every asset that it is the 3rd of the 124 total results. If I enable the pagination (20 results per page), how could I get in my freemarker ADT the number 124 (total number of results)?
In theory, as long as you include a new variable as part of the
optional contextObjects
map mentioned in the liferay-ddm:template-renderer
tag library documentation, then your ADT can have access to any value
it wants.
In practice, it's complicated, because you'll need to customize Asset
Publisher to feed that value to your ADT. Additionally, if you look at
view_dynamic_list.jspf,
you'll see that asset publisher makes a util method call that returns
a list of AssetEntryResult
objects, which do not include the individual totals as part of their
metadata. This means that the only total you have to provide to your
ADT is the global total that is stored on the SearchContainer
.
Powered by Liferay™