We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: Timetravel

Development and Programming

Wouter Vervloet's avatar
Wouter Vervloet
758 posts
15 years ago
Wouter Vervloet's avatar Wouter Vervloet

Timetravel is an add-on for EE 2.x and EE 1.6.x that makes navigating through entries by day, month or year a breeze. It behaves similar to the default pagination, except that it uses dates in the URL instead of page numbers.

It’s usage is pretty much self explanatory and ties in to some of the default behavior of the channel:entries tag.

Example:

{exp:timetravel by='day' channel='news'}

  {oldest}<a href="http://{path=news}">Oldest</a>{/oldest} 
  {older}<a href="http://{path=news}">Older</a>{/older} 
  {newer}<a href="http://{path=news}">Newer</a>{/newer} 
  {newest}<a href="http://{path=news}">Newest</a>{/newest}

  <strong>{current format='%F %j%S, %Y'}</strong>

{/exp:timetravel}

{exp:channel:entries channel='news'}
    // Your entry data
{/exp:channel:entries}

The timetravel tag accept many of the same parameters that are also available to the channel:entries tag.

Parameters

by = day|month|year

author_id = Member id category = Category id category_group = Category Group id channel = Channel short name entry_id_from = Entry id entry_id_to = Entry id group_id = Member group id show_expired = yes|no show_future_entries = yes|no status = Status start_on = Date (%Y-%m-%d %H:%i) stop_before = Date (%Y-%m-%d %H:%i) uncategorized_entries = yes|no username = Member username

As you can see the list is almost the same as the channel:entries tag, except for a few that would interfere with the inner workings of Timetravel.

The URL’s generated by the {path} tags inside the Timetravel navigation are appended with the date.

// This
{older}<a href="http://{path=news}">Older</a>{/older}

// Outputs something like this
<a href="http://www.domain.com/news/2010/05/21">Older</a>

Because the channel:entries tag already allows for entries to be displayed by day, there is no need to change anything to it. The only exception to this is navigation by year. EE doesn’t filter the resultset based on year alone, unless you specifically tell it to by using the year parameter.

{exp:channel:entries channel='news' year='{segment_2}' dynamic='off'}
    // Your entry data
{/exp:channel:entries}

A copy of Timetravel is available for download on GitHub for you to play with.

  • Timetravel for EE 2
  • Timetravel for EE 1.6.x

I hope you like it and wish you godspeed on your travels through time.

Greetz, Wouter

       
Todd D.'s avatar
Todd D.
460 posts
15 years ago
Todd D.'s avatar Todd D.

Thanks Wouter. I think this plugin will get a lot of use as people move to EE2 and hear about this new approach to pagination. Nice work!

       
Wouter Vervloet's avatar
Wouter Vervloet
758 posts
15 years ago
Wouter Vervloet's avatar Wouter Vervloet

Update: Timetravel is now available for EE 1.6.x! (first post updated)

Greetz, Wouter

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.