adrian

Page Rename Options

45 posts in this topic

Hi,

somehow it seems I've missed this answer... so sorry for the late reply.

ex, this is the title "Συμβουλευτικές υπηρεσίες κατά της διάβρωσης", after renaming the page name ends up in an empty string.

I've disabled the whole pageRename thing, and it's really not high priority, ppl are advised to change the page name manually if applicable.

Kind regards!

Share this post


Link to post
Share on other sites

Thanks for the update. But PW doesn't handle creating a page name from that title in the first place - the name stays blank and you have to manually enter a name. If this also what you experience? Sorry, I don't ever use the Multilanguage stuff, so not completely sure how it all works.

The one thing I could probably do would be to not change the name if it would end up blank, but I want to better understand what PW normally does when entering a page title like that.

Share this post


Link to post
Share on other sites

No problem, it helps subscribing to this topic :-)

Actually I never thought about that... the Greek came up the fourth language after some time...
When leaving blank, PW creates the same name as the default language. Of course at least two languages have to be present, so in a non-multilingual environment with only e.g. Greek, I really wouldn't know...

In this particular case, the Greek pagename with the default 'English' name became blank after renaming [which makes sense after your comment], so I disabled the module.

Anyway... you're updated :-) and again, nothing to worry about...

[to be filed under "whenever I have some time and I feel like thinking about it, in the year 2026..."] 

Share this post


Link to post
Share on other sites

Thanks @videokid for the explanation.

I have just committed an update to the module so that it won't overwrite the name if the result will be empty.

Hopefully this will allow it to work in this multi-language situation.

I appreciate knowing if it now works for you as expected.

I honestly don't know how anyone makes it through the development phase of a large site without this module - I would end up with so many mis-matched titles/names - the editors I deal with never remember to change the name to match. :)

Thanks,

Adrian

Share this post


Link to post
Share on other sites

Nono, thank you for this quick action!

Somewhere next week I'll try it out and I'll let you know how it behaves.

Thanks!

Share this post


Link to post
Share on other sites

Hi everyone,

Thanks to prompting from a good friend who is doing his first site with PW, I have added the ability to completely lock/prevent changing of the page name.

This is achieved by a new option: "Automatically rename the name field to match the title" - this is checked by default as this is the whole reason this module was created. But now by unchecking this, you can revert to PW's default behavior.

Why not just uninstall once the site is live you ask? Good question :) The reason is that now you can use the "Prevent Manual Changes" options along with this to make it impossible to change the name of the page.

The default PW behavior allows all site editors to change the name - but if you want to prevent this, you can now do it easily.

You can also add superusers (and other roles) to the list of roles that are exempt from the "Prevent Manual Changes" option.

Anyway, hopefully others will find this useful as well.

2 people like this

Share this post


Link to post
Share on other sites

I just added another option to this module that can limit the automatic naming to match the title to only unpublished pages. If the page is published, the name will be left untouched.

This might help out those users who are steadfast in their opinion that the URL to a page should never change - not judging this opinion by the way - it is a very strong argument. 

With this new setting you can change the title multiple times while it's still in unpublished (in draft if you will) and the name will change automatically. Once it is published, changes to the title won't affect the name.

Hope that wins a few more users over :)

4 people like this

Share this post


Link to post
Share on other sites

Hi Adrian,

Nice module. Thanks. I didn't notice it until now. It works properly with my ProcessSetupPageName Module.

One wish: It would be great to have an option (checkbox) to switch from blacklisting to whitelisting for templates.
Meaning switching from 'Exclude Templates' to 'Include Templates' from actions of the module.

Share this post


Link to post
Share on other sites

Hi @kixe - glad you're finding it useful.

I have just added Exclude/Include switch that you suggested. The default is exclude to ensure backwards compatibility for those upgrading and not checking anything new in the settings.

Thanks for the suggestion and please let me know if you have any problems.

Also, I have now made the module always ignore the homepage - before I recommended users exclude it on multilanguage sites, but I couldn't think of any reason why it would be needed on any site, so I think this is simpler and cleaner.

2 people like this

Share this post


Link to post
Share on other sites

Hello Adrian,

I have got the following error message after trying to add a child page.

Screenshot_18.jpg

Can you check this please.

PW 3.0.33, latest PageRename Module version, the child page is excluded in this case.

Thanks

2 people like this

Share this post


Link to post
Share on other sites

Hi @adrian,

I've started to use you module, it is great when editing in admin, but it is useless when I change the title using the API. According to you code it uses javascript for it, which is good that is reflects the changes immediately. But could you consider checking the name on page save if it matches the title and change it if not (of course respecting the module settings)?

Share this post


Link to post
Share on other sites
5 minutes ago, Richard Jedlička said:

but it is useless when I change the title using the API

Actually, it should work for saves via the API as well. At least it used too :) 

This save hook: 
https://github.com/adrianbj/PageRenameOptions/blob/12d18066b89a37fd9a7e05204599b09388bf6f82/PageRenameOptions.module#L117 

should take care of it.

Let me do a little investigating here.

Share this post


Link to post
Share on other sites

As I see it's used only when the page has no settings tab, which is not my case. I've tried changing the title using API but it didn't work.

1 person likes this

Share this post


Link to post
Share on other sites
1 minute ago, Richard Jedlička said:

As I see it's used only when the page has no settings tab, which is not my case. I've tried changing the title using API but it didn't work.

My apologies - you are right :)

I am actually in two minds about supporting this via the API - I wonder if perhaps it should be controlled by an additional module config setting so devs can decide if they want this or not.

I feel like this is something you can do in the API yourself when you change the title? But maybe it would be easier if this module handled any required logic so you didn't have to think about?

Share this post


Link to post
Share on other sites
1 minute ago, adrian said:

I am actually in two minds about supporting this via the API - I wonder if perhaps it should be controlled by an additional module config setting so devs can decide if they want this or not.

It would be great :-)

1 minute ago, adrian said:

I feel like this is something you can do in the API yourself when you change the title? But maybe it would be easier if this module handled any required logic so you didn't have to think about?

You, I can handle it myself, but the module handles also the conflicting page names, which is not trivial code.

Share this post


Link to post
Share on other sites

Or instead of adding an option, you can, as I've written always check the name on page save if it corresponds to the title (according to settings) as a fallback to javascript.

Share this post


Link to post
Share on other sites

Hi @Richard Jedlička - sorry for the delay on this - it's been a busy module support week :)

I am going to PM you the new version that adds support for this because I haven't managed to test thoroughly yet and there were quite a few changes.

Please let me know if it does what you need.

Share this post


Link to post
Share on other sites

Hi everyone,

Thanks to @Richard Jedlička for testing and ideas, there is a new version available.

New features, both off by default:

  • Option to control pages saved via the API - respects all defined settings, just like via the admin GUI.
  • Option to set the name to match the title, even if the title wasn't changed during the current page editing event.

Let me know if you notice any issues with this new version.

1 person likes this

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.