Search code examples
phpexpressionexpressionengine

Skipping an ExpressionEngine Chanel Entry


So I'm working on the EE build, and I'm having a little issue skipping channel entries that have already passed.

I put in the date parameter to only show those with an end date that is greater than or equal to the current time, still didn't work.

So I came up with an if then statement idea. If the channel entry is in the past it will just skip it and go to the next one. Continuously doing this until an entry that is suitable works.

I guess my question is if there is a way to make an offset a global variable?

SN: The build wasn't done the best, which is why the ideas that I came up with that normally would work don't.


Solution

  • Can you post your {exp:channel:entries} tag so that we can more effectively debug your issue? Just going off of what you've written, it seems like you may have used an incorrect 'date' parameter. The correct parameter to use is the start_on parameter. The documentation for that parameter shows example code for ignoring entries that were published in the past and should clear up any questions you have about how to implement it.

    Please elaborate on your question if you still need help!

    Updated answer:

    Hey Jamal, thanks for posting your code. I would definitely set your start_on parameter to start_on="{current_time format='%Y-%m-%d %H:%i'}" and then troubleshoot from there. If you're seeing an error or no generated code after making this change, it's most likely a sign of a problem somewhere else and should be fixed.

    You could try hard coding a date for the start_on parameter, like so:

    start_on="2012-06-18 03:39"
    

    You could also try adding dynamic="no" to the tag, but I can't recall if that 's supposed to change anything in this instance.

    If you're still having trouble with this parameter, please turn on template debugging and EE's output profiler (both found in Admin > System Administration > Output and Debugging ), refresh the page, and try to determine what the issue is based off of the debugging info that appears on the screen.