Marvin Scharle Posted October 18, 2014 Share Posted October 18, 2014 (edited) Hello everybody, I'd like to introduce a new module to you. It automatically adjusts pages' URLs based on naming patterns. It allows you to specify a general pattern for all pages or individual patterns per template. It is available in the ProcessWire module directory. Also you may find the code here. New: Auto Name has been updated to Version 1.1. Changes: It is now possible to set a human-readable date format for the created and updated fields Renaming can now be restricted to unpublished pages Includes a fix for a bug that accidentally renamed system pages I'm looking forward to your feedback. Thanks in advance, Marvin Edited October 21, 2014 by Marvin Scharle 14 Link to comment Share on other sites More sharing options...
adrian Posted October 18, 2014 Share Posted October 18, 2014 Hi Marvin, I love it, although I am surprised you got a like from Antti on this, given his dislike for changing the url after the page has already been created I wonder if it might be nice to have an option to determine whether the rename will happen only the first time the page is created, or if it can change every time the page is saved (the current behavior). Just a thought - if you could check to see if my PageRenameOptions module is installed and check its settings to see what behavior is selected and honor that ? Just an aside - your module seems to works quite nicely with my Redirect IDs module. If there was a setting in your module to prevent subsequent renames, Redirect IDs could ensure redirects work so long as they use something like "id title" in your config settings. I know PagePathHistory would also be effective. Just exploring all the different options we now have 1 Link to comment Share on other sites More sharing options...
apeisa Posted October 18, 2014 Share Posted October 18, 2014 I like all the new modules To be honest, I first thought the naming will be only done while publishing, not when edited. But the screenshot tells otherwise. Link to comment Share on other sites More sharing options...
Marvin Scharle Posted October 21, 2014 Author Share Posted October 21, 2014 Hello @adrian and @apeisa, @adrian if renaming the page only the first time as an option is a feature wish, we can add this. Beside this, we can include support for your module. Please explain me, how to access the status and which status(es) allow a change of name. @apeisa what is the problem with renaming the page after being edited? I haven't accomplished any problems with this, yet. Thanks! Link to comment Share on other sites More sharing options...
kongondo Posted October 21, 2014 Share Posted October 21, 2014 ....@apeisa what is the problem with renaming the page after being edited? I haven't accomplished any problems with this, yet. Er, Google indexing, SEO and all that.... 1 Link to comment Share on other sites More sharing options...
netcarver Posted October 21, 2014 Share Posted October 21, 2014 This could work fine for intranet sites. In fact I do something similar on the internal club admin site I'm working on now where we want the names and titles of certain pages to be built consistently from other fields in the page. Link to comment Share on other sites More sharing options...
Marvin Scharle Posted October 21, 2014 Author Share Posted October 21, 2014 @kongondo I was thinking about ProcessWire limitations, but of course, this makes sense Link to comment Share on other sites More sharing options...
Philipp Posted October 21, 2014 Share Posted October 21, 2014 This could work fine for intranet sites. That is were this module comes from. Sites where SEO aspects might not be the first priority. Also, couldn't PagePath History help here? 2 Link to comment Share on other sites More sharing options...
adrian Posted October 21, 2014 Share Posted October 21, 2014 Er, Google indexing, SEO and all that.... Does it really matter so long as you have Page Path History installed given that it automatically sets up 301 redirects? @adrian if renaming the page only the first time as an option is a feature wish, we can add this. Beside this, we can include support for your module. Please explain me, how to access the status and which status(es) allow a change of name. I think some users would definitely like the rename only on first time / initial publish. Thinking about compatibility with PageRenameOptions - I think the key settings would be "Initial Differences Protected" and "Live Changes Protected" along with the role based exemptions for these rules. I guess the biggest problem is that your module works on page page, whereas mine with via JS to change the name on the fly. It might actually be a bit of a challenge to reconcile both. Also, I have a bug for you - your module is also affecting the names of users - I expect there might be other things to that will be changed by this that shouldn't be. Link to comment Share on other sites More sharing options...
kongondo Posted October 21, 2014 Share Posted October 21, 2014 Yes, exactly...PagePath History does help; Antti sings about it all the time IIRC Link to comment Share on other sites More sharing options...
apeisa Posted October 21, 2014 Share Posted October 21, 2014 Renaming "News" page into "Latest news" does brake url for all 20 000 news you have in archive, doesn't it? ProcessWire has this right by default, trust me PagePathHistory helps a lot (I love it!), but not everything. Link to comment Share on other sites More sharing options...
adrian Posted October 21, 2014 Share Posted October 21, 2014 Renaming "News" page into "Latest news" does brake url for all 20 000 news you have in archive, doesn't it? ProcessWire has this right by default, trust me PagePathHistory helps a lot (I love it!), but not everything. Why does it break ithe 20000 news items if PagePathHistory is installed. What doesn't it work for ? Is there something I haven't come across yet that we all need to know about ? Whether they should be installed on a live site is a matter for each developer, but during development I do think that a tool that matches the name to the title is very useful. Link to comment Share on other sites More sharing options...
gebeer Posted October 21, 2014 Share Posted October 21, 2014 Thank you for the module. Just one suggestion: In terms of human readable URLs, wouldn't it be better to attach the time as a Datetime string like "2014-10-21-16-04-33" rather than the unix timestamp? 1 Link to comment Share on other sites More sharing options...
apeisa Posted October 21, 2014 Share Posted October 21, 2014 Adrian, it does redirect (if pw handles the db write for 20 000 pages recursion without memory issues). But I do consider the redirect not optimal. News are often migrated from old url schema and there might be one redirect already, then it would be double redirect (performance issue also). Also we might have ajax polling etc, which won't work with redirect at all. I think "reusing" pages instead of remove + new as bad practice. Although might be good feature in dev phase. Personally I like to plan urls before developing, so no need to play with them afterwards. Link to comment Share on other sites More sharing options...
adrian Posted October 21, 2014 Share Posted October 21, 2014 Thanks for your thoughts Antti. As for the 20 000 pages recursion writing to the database - admittedly I haven't studied the PagePathHistory module, but from what I have seen, it only stores the path to the parent page that was actually changed, eg news with the id for the page which is now named latest-news. It doesn't store rows for each of the child pages. Or sorry if I am missing your point? Ajax polling is definitely a good point, although I don't usually have pages that are called via ajax editable by non-superusers, but I guess this could definitely be an issue in some cases. I like to plan too, but clients often don't 1 Link to comment Share on other sites More sharing options...
apeisa Posted October 21, 2014 Share Posted October 21, 2014 Didn't know that, Ryan has pretty great technical solution there! I still stick with my opinion here: better to keep url change always clear decision. Avoid unnecessary redirects and url changes vs. some "/sample-page/" url from cheating at the beginning of the project 1 Link to comment Share on other sites More sharing options...
Marvin Scharle Posted October 21, 2014 Author Share Posted October 21, 2014 Hello everybody, thank you for this vital discussion. We've updated Auto Name to Version 1.1, addressing some of the issues and thoughts of this thread. Changes: It is now possible to set a human-readable date format for the created and updated fields Renaming can now be restricted to unpublished pages Includes a fix for a bug that accidentally renamed system pages If you have any additional thoughts, please post them here or open up a ticket on GitHub! Thanks! Marvin 6 Link to comment Share on other sites More sharing options...
kongondo Posted October 21, 2014 Share Posted October 21, 2014 What happened to the screens in the first post? 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