2014-02-16, 07:09:03
(2014-02-12, 04:43:30)zfz Wrote: I've actually just replaced the whole if(!empty(slug))-else with your new line so all posts use the date by default. It looks more uniform and opens up the possibility of fishing for a particular day's news in the future, and also allows for a quick "back then on this day" link by just modifying the permalink.
If you do it that way you should hide the slug input field, as it will be ignored, i.e. anything that the user enters there will be replaced.
Also, if the user edits the date, the slug will change. Is that is what you wanted?
(2014-02-12, 04:43:30)zfz Wrote: I hope I am not asking too much; if you ever consider making this an option, would it be possible to have the custom slug URL pre-populated for people using this option?
I'd rather generate the slug when saving the post (like in the patch) instead of pre-populating it (unless it is meant to be editable). Any advantage on pre-populating?
I'm actually considering adding this option, probably as a gsconfig setting for now. This is what I've thinked of:
- A setting to define the date-based slug structure for new posts (strftime format). If defined, the slug field would not be visible/editable.
- Another setting to enable viewing/editing the slug field (if previous setting is defined).
- And maybe another setting to force updating the slug if an existing post is edited and saved (like in your version of my patch). I don't think this is convenient for blog-type sites, as permalinks should be "permanent", but I suppose that this may be useful for some sites.
Ideas welcome.
(2014-02-12, 04:43:30)zfz Wrote: Thank you again for the quick patch!
You're welcome!