bcartier Posted October 21, 2016 Share Posted October 21, 2016 I'm wondering why there isn't a way to access published_date from the templates... I've seen Ryan comment to other questions about this that they should use 'created', but it seems to me they are not the same. For example, we have a team writing articles. We might have a page that's first created in October (saved without publishing), and isn't published until November. In these cases the created and published dates are a month apart. If I want to do something like turn off the comment form in the article template for articles published more than 6 months ago, what are my options for doing that accurately? Is there a reason published date has been excluded from the PW api? Link to comment Share on other sites More sharing options...
AndZyk Posted October 21, 2016 Share Posted October 21, 2016 Hello bcartier, I don't know, where you did get the published_date but in the API reference there is: Quote $page->published int Unix timestamp of when the page was published. Source: http://processwire.com/api/ref/page/#pw-methods-common Regards, Andreas 1 Link to comment Share on other sites More sharing options...
bcartier Posted October 21, 2016 Author Share Posted October 21, 2016 Thanks AndZyk! I had the feeling I was missing something obvious . I didn't see it in the cheat sheet and assumed it wasn't available. Link to comment Share on other sites More sharing options...
szabesz Posted October 21, 2016 Share Posted October 21, 2016 Unfortunately the Cheatsheet is outdated, I never use it. The new API reference (linked by @AndZyk) is up-to-date because it is generated from source code comments, and @kongondo's ApiGen is relatively new, although it has not been updated recently: http://kongondo.github.io/ProcessWireAPIGen/ 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