solved Listing events by date ending soonest

Developer Networks
Developer Networks
@developer-networks
8 years ago
566 posts
I was looking in the docs for information about this however only seen calendar examples.

I can see the event_date. Is there already a way to list the events happening soonest based on the event date in the list?

{jrCore_list module="jrEvent" order_by="event_date desc"  limit="5"}


Is what I have so far. Will this require a smarty function or is this already implemented?
updated by @developer-networks: 11/24/16 01:06:39PM
michael
@michael
8 years ago
7,715 posts
there is the $smarty.now variable that will give you the current timestamp, you may be able to use that somehow:
search1="event_date <= `$smarty.now`"
would show you only events in the future from this point in time.
Developer Networks
Developer Networks
@developer-networks
8 years ago
566 posts
Is it possible that I could use:
 order_by="event_date <= `$smarty.now` desc" 

I think this would achieve my results but it hangs up the array
michael
@michael
8 years ago
7,715 posts
No.

The order_by clause tells the system what order you want the returned results to be in.

Try translating that code into an english sentence and you'll see it makes no sense:
"the order that I want to show the returned results in is by date greater than today order and from the highest to the lowest."
Developer Networks
Developer Networks
@developer-networks
8 years ago
566 posts
michael:

"the order that I want to show the returned results in is by date greater than today order and from the highest to the lowest."
lol
thats exactly what im trying to get the list to do....
Show the upcoming events:
"by date greater than today and in order from the lowest to the highest."
updated by @developer-networks: 08/24/16 12:10:53AM
michael
@michael
8 years ago
7,715 posts
That sentence makes no sense. greater than is.not.an.order
* a to z is an order,
* highest to lowest is an order
* greater than 5 is NOT an order

try:
{jrCore_list module="jrEvent" search1="event_date <= `$smarty.now`" order_by="event_date asc"  limit="5"}
paul
@paul
8 years ago
4,326 posts
{jrCore_list module="jrEvent" search="event_date >= `$smarty.now`" order_by="event_date numerical_asc" . . . }


--
Paul Asher - JR Developer and System Import Specialist
Developer Networks
Developer Networks
@developer-networks
8 years ago
566 posts
Thanks.

Ill try to build off that.

I appreciate the help.
updated by @developer-networks: 08/24/16 02:24:42AM
paul
@paul
8 years ago
4,326 posts
Don't forget the 'show past events' option in the module config. All 'past' events can be disabled by default with this setting.


--
Paul Asher - JR Developer and System Import Specialist

Tags