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
|
Posted: 13 June 2016 12:45 PM |
|
|
|
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
|
Posted: 13 June 2016 01:38 PM |
# 1
|
|
|
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
|
Posted: 13 June 2016 01:59 PM |
# 2
|
|
|
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
|
Posted: 13 June 2016 02:23 PM |
# 3
|
|
|
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
|
Posted: 13 June 2016 03:25 PM |
# 4
|
|
|
Okay I’ll check. Thanks!
|
|
|