ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

equivalent of "If Future Entry"

April 13, 2009 1:32pm

Subscribe [4]
  • #1 / Apr 13, 2009 1:32pm

    neongray

    13 posts

    I am displaying a list of albums. Their entry date is their release date. I want to list all albums using the show_future_entries=‘yes’ parameter, and label what is “currently out” and what is a “future release”. looking for a way to either check if the current date is before the entry date, and then use that IF to create a title, or restrict my weblog:entries to ONLY show future entries (latter is easier)

    Thanks

  • #2 / Apr 13, 2009 1:39pm

    Arun S.

    792 posts

    Not tested, but maybe this would work:

    {if current_time < entry_date } Future Release {/if}

    That would be problematic because it also takes the time into account.  So, you might get an instance where it shows as a future release the day it’s supposed to release (for a few hours anyway).

    Your other options are to:

    1.  Use PHP
    2.  User the weblog:entries tag’s start_on= parameter.  This would do something like what you mentioned in your post (display all entries posted after a certain date).

    Edit:  The variable is current_time not current_date.  Thanks, Mark.

  • #3 / Apr 13, 2009 2:01pm

    Mark Bowen

    12637 posts

    Just as a quick note on this I think you’re probably looking for the {current_time} variable as ExpressionEngine doesn’t have a {current_date} variable as far as I know. You should also be able to do something like this I think to get at what you need :

    {if "{current_time format="%U"}" < "{entry_date format="%U"}"}
    This is a Future release.
    {/if}

    Hope that helps a bit.

    Best wishes,

    Mark

  • #4 / Apr 13, 2009 7:16pm

    neongray

    13 posts

    Thank you both very much for the help, I’m all set now!

  • #5 / Apr 13, 2009 7:21pm

    Mark Bowen

    12637 posts

    Excellent 😊

    Hope it all goes well for you.

    Best wishes,

    Mark

  • #6 / Apr 22, 2009 4:07pm

    [email protected]

    119 posts

    kind of along the same lines, I am trying to figure out a way that I can sort my events that I have set in the future. So you pick “day | week | month” and it would show the corresponding time period. I know there is the display=“week” variable however that only shows past entries. I know you can also add “show_future_entries” but then I’ll have past entries for a week and all future entries. Any ideas?

    To give you a better idea, here is my site: http://www.lcbcchurch.com/happenings/event-link/date/text/

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases