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
FR: Chronological Dates for Booking Events in Asset Publisher (Sort By)
Briefly the history of this has always been to not fix it because "start and end time is not common across all assets". True however it has never been possible to sort and display event assets correctly in asset publisher. A freemarker solution is flawed due to other issues with inability to "limit number of items" based on end date (can only select a number of items, is also not context aware).
Vote!!
Vote for this to be fixed!!
https://issues.liferay.com/browse/LPS-147492
Ask:
Asset publisher to be more context aware when a single asset
type is selected, such as "Calendar"
Problem:
Can only sort by published and modified date. A template
developer then has to work around the issues by building an array of
events to create the conditions where it's possible to order the array
to show the events in the correct chronological order.
Why is fixing this in Freemarker flawed?
This approach is flawed and may appear to work initially
because the array will eventutally fill up with events that occured in
the past. Due to Liferay's inability to expire elapsed events. The
only way to make this array work is to constantly update the number of
items to accomodate more and more events so that current events can
make it into the array. Say you want to show 10 items (you actually
have to select 100 or 1000 in AP, in order to be sure to get the data
needed). Then with freemarker filtering you will have to either figure
out how to expire events with end dates in the past automatically (and
hope the AP configuration was changed to published date) or keep
expanding the number of items AP can pull in as the calendar fills up.
Why this needs to happen before Freemarker?
Because freemarker is filtering after AP has filtered, this is
a problem with Asset Publisher filtering and needs to be addressed
before Freemarker gets the data.
Links:
https://liferay.dev/ask/questions/development/re-sort-calendar-events-in-asset-publisher-19
https://stackoverflow.com/questions/39595201/how-do-i-sort-my-calendar-by-start-date-using-freemarker
Powered by Liferay™