Display Next Upcoming Date of a School Session
Newbie still figuring out how best to use LV. Can I use it to display the next upcoming date for a school that has 7 sessions each year?
For example, if I use the current time, I'd want to display the very first date that appears in the future.
The client needs to easily update the dates... so would I create a group for "School Sessions" and then create a separate variable for each date? If so, can I compare all the variables in a group to the current time?
Thanks!
Replies
Low 19 Jun 2012 09:12
If you're going to create a variable per date, you'd have to create a lot of conditionals to do the checking. Instead, I'd probably use Pixel & Tonic's Matrix as a single variable, and store each date in a row.
Then you could use a tag like this to get the correct date, using Matrix' handy parameters:
...untested, but something like that could work.
TR Douglas 20 Jun 2012 20:39
And indeed that does work... been testing a range of other vars today and starting to pick it up... many thanks!
TR Douglas 9 Sep 2012 15:57
Follow up on this question now: Can we use the output of a plugin inside the low_variables:pair?
But we don't get the correct result when we replaced the current_time tag with the plug-in tag in the low_variables:pair.We made a very basic plug-in to subtract 4 days from the current time.
Is this feasible? Thanks much!
Low 10 Sep 2012 05:50
As a rule, using a plugin tag as input for another tag's parameter will not work, due to parse order. You'd have to change the plugin to work as a tag pair and wrap it around the LV tag.
TR Douglas 10 Sep 2012 12:11
Ahh, OK, we'll work on that... thanks!