gornycreative Posted December 29, 2023 Share Posted December 29, 2023 I thought I recalled somewhere seeing that it was possible to format the timstamps for the pageListLabel. Did I dream it? Is that just a fantasy? Something like {created:YYYY-mm} or something like that? Can the createdStr date format be configured in a setting someplace? I can do this with other means but for some reason I felt like there was a way to do this... Maybe I'm confusing it with being able to alter the date in the default child naming setting? Link to comment Share on other sites More sharing options...
monollonom Posted December 30, 2023 Share Posted December 30, 2023 Is it possible you have this in mind? https://processwire.com/api/ref/pages-names/page-name-from-format/ 1 Link to comment Share on other sites More sharing options...
gornycreative Posted December 30, 2023 Author Share Posted December 30, 2023 Yes it is, I created an issue for the feature: https://github.com/processwire/processwire-requests/issues/514 Essentially I would like to be able to use something like {created:yy-mm} to be able to show alternative forms of the datetime in the label. Should be an easy fix since the parsing code already exists in the PagesNames class (in theory). Link to comment Share on other sites More sharing options...
gornycreative Posted December 30, 2023 Author Share Posted December 30, 2023 How did you get to that API ref page? I could only find this one, which is empty. https://processwire.com/api/ref/pages/names/ Link to comment Share on other sites More sharing options...
monollonom Posted December 30, 2023 Share Posted December 30, 2023 1 hour ago, gornycreative said: How did you get to that API ref page? I could only find this one, which is empty. https://processwire.com/api/ref/pages/names/ If you click on the return value "PagesNames" you can get there. As to where / how I encountered it, it was from the "Name format for children" option in the ProcessTemplate edit page: 1 Link to comment Share on other sites More sharing options...
gornycreative Posted January 1 Author Share Posted January 1 Yeah I did find it that way as well. Thanks! I also forgot until I did a code audit yesterday that it is pretty trivial to override the getPageListLabel() method when using page classes. It still might be worth bringing the parsing over for folks not interested in doing it that way. 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