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: Last Entry - get last entry date (1.6.8)

Development and Programming

Bjørn Børresen's avatar
Bjørn Børresen
629 posts
16 years ago
Bjørn Børresen's avatar Bjørn Børresen

Last Entry is a small plugin to get the entry date of the last entry in one or more weblogs.

Usage:

{exp:last_entry weblogs='news|blogs|videos' format='%Y-%m-%d'}

This would search through the news, blogs and videos weblogs and find the date of the latest entry. This could output 2010-01-18 for instance. The format parameter decides the date format and works the usual way. It only uses one SQL query so I would imagine that it’s faster than the alternative (that would be to use the {exp:weblog:entries} tag).

If you’d like to find future entries as well add “allow_future_entries=’yes’” to the syntax above.

It can also be used in other tags like this:

{exp:weblog:entries weblog="{my_weblog}" start_on="{exp:last_entry weblogs='news|blogs|videos'
 format='%Y-%m-%d'} 12:01 AM" stop_before="{exp:last_entry
 weblogs='news|blogs|videos' format='%Y-%m-%d'} 11:59 PM"  
disable="categories|category_fields|member_data|pagination|trackbacks"
 parse="inward" }

Note it would probably be better to use embed here to only run the last_entry query once, this is just for example purposes.

Enjoy, and ask here if you have any questions.

Download from github: http://github.com/bjornbjorn/Last-Entry/zipball/master

       
gazaston's avatar
gazaston
128 posts
16 years ago
gazaston's avatar gazaston

Is this something that could be used with {redirect} to automatically generate a URL to the most recent entry?

       
Bjørn Børresen's avatar
Bjørn Børresen
629 posts
16 years ago
Bjørn Børresen's avatar Bjørn Børresen

Sorry, it will only display the date for the last entry.

       

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.