Module

Archived
Forum
(read-only)


For official support, visit the official support site »

Link Vault

ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5

Back to this add-on's main page
View Other Add-ons From Masuga Design

     

Showing downloads from the past three months?

Support Request

Mike Mella
Mike Mella

I have Link Vault set up to show the most popular downloads using the :records tag. I’d like to limit these to only those downloads within the past three months.

Possible?

Ben Kohl
# 1
Ben Kohl

Yes. The records tag has a “start_date” parameter. The best date format to use is Y-m-d. Ex: start_date=“2016-06-13”

Mike Mella
# 2
Mike Mella

Thanks Ben.

I guess when i say “last three months” I mean dynamically. So if I check the site today, I would see the top downloads from three months ago until today. If I check the site next Monday, I’d see the top downloads from the three months before that day. So I wouldn’t be able to hard-code a start date.

Make sense?

Ben Kohl
# 3
Ben Kohl

Ideally, you’d be able to set a global variable that generates the date 3 months ago relative to today BUT user-defined global variables parse too late. A workable alternative would be a plugin/module tag that generates the date then you’d just have to add a parse=“inward” parameter to the :records tag to get that date tag to parse first.

{exp:link_vault:records start_date="{exp:custom_plugin:custom_date date="3 months ago" }" }
...
{/exp:link_vault:records} 

I’m sure there are some add-ons out there that can generate the relative dates but I don’t know one off the top of my head.

Mike Mella
# 4
Mike Mella

Okay I’ll check. Thanks!