Plugin

Developer
Supported

Timetravel

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Wouter Vervloet

     

You must be logged in to post.

Passing current month/year without segments?

Support Request

ejaeDesign
ejaeDesign

Hi there,

Timetravel works great so far, and thanks for releasing it.

I do need it to work where there are no segments in the URL however—is that possible? For example, when the landing page shows the current month’s content:

http://www.acme.com/newsletters

Which parameters should I pass off to the tag to make it work as this URL:

http://www.acme.com/newsletters/2013/01 (where 01 is the current month)

Thanks very much!

Jae

Wouter Vervloet
# 1
Developer
Wouter Vervloet

Hi Jae,

I believe you can just add the following to your exp:channel:entries tag and it should work

{exp:channel:entries channel='newsletters' display_by='month' limit='1'}
// rest of your template here 

The combination of the display_by and limit parameters tells EE you want to show only the last month which contains entries. (docs)

– Wouter

ejaeDesign
# 2
ejaeDesign

Hi Wouter,

Thanks for the quick reply. I actually meant for the {exp:timetravel} tag to work without having year/month in the segment.

For example, in this dev page: http://woodleigh.flyingfont.com/newsletters

Can I pass any parameters to the {exp:timetravel} opening tag to behave the same as:

http://woodleigh.flyingfont.com/newsletters/2013/01

Hope this makes sense :)