Martin Muzatko Posted November 12, 2014 Share Posted November 12, 2014 I tried to create a very minimalistic news system. When I found this here: http://processwire.com/api/templates/ <ul> <?php $features = $pages->find("template=press_release, featured=1, limit=3, sort=-date"); foreach($features as $feature) { echo "<li>" . "<h3><a href='{$feature->url}'>{$feature->title}</a></h3>" . "<span class='date'>{$feature->date}</span>" . "<p>{$feature->summary}</p>" . "</li>"; } ?></ul> Do I actually need a field called date, or can I access the creationdate without creating one?I'd like to find some wikipages regarding that topic. Default fields that are always accessible. Thanks in advance! Link to comment Share on other sites More sharing options...
kongondo Posted November 12, 2014 Share Posted November 12, 2014 (edited) Welcome to PW and the forums Misan.. Have a read here for all $page properties and methods: http://processwire.com/api/variables/page/ What you want is $page->created: Unix timestamp of when the page was created or 'created' if in a selector Related - $page->modified: Unix timestamp of when the page was last modified Also useful to read about $pages: http://processwire.com/api/variables/pages/ Edited November 12, 2014 by kongondo Link to comment Share on other sites More sharing options...
Martin Muzatko Posted November 12, 2014 Author Share Posted November 12, 2014 this helps a lot! Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now