Jump to content

Auto Name


Marvin Scharle
 Share

Recommended Posts

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 by Marvin Scharle
  • Like 14
Link to comment
Share on other sites

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 :)

  • Like 1
Link to comment
Share on other sites

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

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

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

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

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

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 ;)

  • Like 1
Link to comment
Share on other sites

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 :)

  • Like 1
Link to comment
Share on other sites

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

  • Like 6
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...