adrian Posted September 26, 2014 Share Posted September 26, 2014 (edited) This module allows the page name to change when the title is edited. Modules directory: http://modules.processwire.com/modules/page-rename-options/ Github: https://github.com/adrianbj/PageRenameOptions I'd love to think that this module was not necessary for me but, especially during development, I find that page titles often change and I'd really rather have the names/urls match the title. I don't think you can expect clients to remember to change the name when they change the title, or even if they do, they still have to get it right which can be a challenge with a long article names with characters not allowed in page names. With none of the config settings checked, the default behavior is to have the page name always match changes to the page title, but allow the user to manually edit if they want. The options allow you to protect initial differences (changes you may have made as a user with an exempt role), completely disable manual changes, or protect manual name changes from subsequent changes to the title while editing. My preferred settings are to set the exempt role as superuser, and check "Initial Differences Protected" and "Prevent Manual Changes". CONFIG SETTINGS Exempt Roles The selected roles will not be subject to any of the rules below. The name will change automatically with the title, but they will be able to manually edit the page name as desired. Excluded Pages Pages that are excluded from the actions of this module. Changing the titles of selected pages will behave as though this module is not installed. For multi-language sites it is recommended to select the site's homepage. Initial Differences Protected If checked, further changes to the name (to match a changing title) will not happen if the name is already different from the title (evaluated on page edit initial load) Prevent Manual Changes If checked, it won't be possible to manually edit the name. If checked, this will disable the "Live Changes Protected" setting since it won't be possible to make any manual changes. Live Changes Protected If checked, further changes to the name (to match a changing title) will not happen if the name field was manually changed at any time during the current page edit. Please test the behavior of each setting thoroughly so you understand what each one does! Please let me know if you have any further requirements around permissions / role access to the module's functionality. Edited October 24, 2015 by adrian Update with new config settings 12 Link to comment Share on other sites More sharing options...
cstevensjr Posted September 26, 2014 Share Posted September 26, 2014 You are on fire today! Great job! 1 Link to comment Share on other sites More sharing options...
Martijn Geerts Posted September 26, 2014 Share Posted September 26, 2014 Not only today Charles Thanks adrian, will check it out soon. 2 Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted September 26, 2014 Share Posted September 26, 2014 I hope it supports transliteration )) Remember, you made a similiar little module just for me "on the fly" a couple of months ago. Glad it is now some bigger and more customizable one for a wider audience. I will try it out and report back. Link to comment Share on other sites More sharing options...
adrian Posted September 29, 2014 Author Share Posted September 29, 2014 Just wanted to mention here that I just made some changes to the config settings that I think give more flexibility, and are hopefully also more logical. I have updated the first post to detail the new options. If you are running the old version and update to this one, please be sure to revisit the config settings. Link to comment Share on other sites More sharing options...
adrian Posted October 27, 2014 Author Share Posted October 27, 2014 Another update today! I noticed more and more people in the forums are using with the "Disable Settings Tab?" option (available via: $config->advanced = true). With this disabled, and if the "Display 'name' field in content tab?" setting is not enabled, the "Name" field is not available for javascript manipulation when the title is changed. This update checks for these two settings and if required it will change rename behavior to work on page save instead of instantly via javascript. This alternate method respects the "Initial Differences Protected" setting, but of course the "Prevent Manual Changes" and "Live Changes Protected" options are not relevant since it isn't possible to manually change the page name since the field is not available in the page edit dialog. This update is therefore only relevant if you are using that "Disable Settings Tab?" option, but if you are and you're using this module, please let me know if you have any problems. 2 Link to comment Share on other sites More sharing options...
adrian Posted October 27, 2014 Author Share Posted October 27, 2014 One more update - The module now applies its rules during the adding of a new page (not just editing like before). Obviously there is no affect for the "Initial Differences Protected" setting, but all other settings are relevant and now work. 1 Link to comment Share on other sites More sharing options...
ceberlin Posted November 7, 2014 Share Posted November 7, 2014 Hi, the module breaks the admin backend of the frontpage here (which has no name!), if "initiial differenes proteced" is on: This(?): $(document).ready(function() { initialTitleConverted = InputfieldPageName.sanitize($(".InputfieldPageTitle input[type=text]").val()); }); causes this error: ReferenceError: Can't find variable: InputfieldPageName The effect is that all javascript is not working. Link to comment Share on other sites More sharing options...
adrian Posted November 7, 2014 Author Share Posted November 7, 2014 Hi ceberlin, Thanks for the report - sorry about this - I'll take a look when I am back at my desk in about 10 days. It might be obvious when I start looking into it, but could you please clarify what "admin backend of the frontpage here" is. What is the path in your browser address bar? Thanks. Link to comment Share on other sites More sharing options...
ceberlin Posted November 7, 2014 Share Posted November 7, 2014 You are right: URL works better than descriptions sometime: "/processwire/page/edit/?id=1" (home) Enjoy the rest of your holidays. Link to comment Share on other sites More sharing options...
adrian Posted November 17, 2014 Author Share Posted November 17, 2014 ceberlin - it should be fixed in the latest version I just committed. Please let me know if it works as expected for you. Sorry for the delay. Link to comment Share on other sites More sharing options...
adrianromega Posted February 24, 2015 Share Posted February 24, 2015 Hello Adrian I wanted to try your module, but it seams not to be working. In settings I have left everything blank and unchecked. I am using processwire 2,5,3, $config->advanced = true and "Display 'name' field in content tab?" is enable. Even so, the page name is not changing when I am updating the title. Please help. Thank you. Link to comment Share on other sites More sharing options...
adrian Posted February 25, 2015 Author Share Posted February 25, 2015 Hi @adrianromega - I have just set up a lightning.pw site running 2.5.3 and everything is working fine at my end. I am just about to PM you the login details. Could you please test at your end and let me know if it works for you. If it does work, then I think there might be another module causing conflict, although that seems unlikely unless you have some something that also has some JS affecting the live name creation process. If it doesn't work, then I am guessing a browser issue - what are you running? Are you getting any JS errors in your console? 1 Link to comment Share on other sites More sharing options...
adrian Posted March 3, 2015 Author Share Posted March 3, 2015 Just to close out the issue that @adrianromega had - turns out it was simply due to diacritics. Once the characters were added to the replacements section of the InputfieldPageName module settings, everything worked as expected. Link to comment Share on other sites More sharing options...
gebeer Posted April 27, 2015 Share Posted April 27, 2015 Thank you for this module. I installed it on a 2.5.28 multi language site and it is not changing page names at all, no matter what aettings I try. I the module supposed to work in a multi language environment? Link to comment Share on other sites More sharing options...
adrian Posted April 27, 2015 Author Share Posted April 27, 2015 Sorry about that, I never tested in a multi-language environment. I just took a quick look and committed a fix that seems to be working fine here. Could you please try out the new version and let me know if it works for you. 2 Link to comment Share on other sites More sharing options...
gebeer Posted April 28, 2015 Share Posted April 28, 2015 Thank you for the quick reply and the fix. I updated and can confirm that it is working now also for multi-language page names 1 Link to comment Share on other sites More sharing options...
gebeer Posted October 8, 2015 Share Posted October 8, 2015 I just discovered that after my client had changed the title of the HOME page, the URL for that page got changed accordingly. Now all pages in the tree got new URLs which is not good for search engine indexing at all. Maybe you could add an option to disallow automatic changes for the name of the homepage? Link to comment Share on other sites More sharing options...
mr-fan Posted October 8, 2015 Share Posted October 8, 2015 I always set the title/name of the homepage and after that i go to >template>home>fieldsetttings for title and set visibility to locked...so this page name is save. I do the same for "critical" content pages like news, events, contact....and so on. regards mr-fan 1 Link to comment Share on other sites More sharing options...
adrian Posted October 8, 2015 Author Share Posted October 8, 2015 I just discovered that after my client had changed the title of the HOME page, the URL for that page got changed accordingly. Now all pages in the tree got new URLs which is not good for search engine indexing at all. Maybe you could add an option to disallow automatic changes for the name of the homepage? Hi @gebeer - I can certainly add an option like that, but I am curious about the behavior you are seeing - is it a multi-language issue? When I change the title of the homepage, the path to it and all child pages does not change because the name of the home page is never used in the URL. Maybe I should add a checkbox to the Settings tab of all pages to disable name changes when checked? 1 Link to comment Share on other sites More sharing options...
acemary Posted October 9, 2015 Share Posted October 9, 2015 (edited) How to rename "Home" title in the home page instead setting NOT to display "home"? Center area ... Wordpress Themes - WP Forum at BFA ... Oh...then there is the new menu option in WordPress that has more features. --- | --- # Edited October 9, 2015 by Martijn Geerts Removed links (spam) Link to comment Share on other sites More sharing options...
gebeer Posted October 9, 2015 Share Posted October 9, 2015 @adrian This seems to be a multilanguage issue. Changing the name of the homepage also changes the path of all children. Would be great to have checkbox like that. Link to comment Share on other sites More sharing options...
adrian Posted October 9, 2015 Author Share Posted October 9, 2015 @adrian This seems to be a multilanguage issue. Changing the name of the homepage also changes the path of all children. Would be great to have checkbox like that. Thanks for clarifying that. I just committed an updated that adds a new "Excluded Pages" option to the module's config section, so you can add as many pages to this as you want. Interestingly while testing, I noticed that for non-multilanguage sites you actually have to have the settings tab disabled to even get the name of the homepage to change with this module at all because in most cases it uses JS to change the name and the name field isn't available unless Settings is disabled. Anyway, please let me know if this new option takes care of things at your end. Link to comment Share on other sites More sharing options...
videokid Posted October 22, 2015 Share Posted October 22, 2015 Hi, today I was planning to use this module, there are four languages... however one is Greek [home -> pagename == gr], renaming the pagename on the Greek part is causing problems, any suggestion how to exempt the Greek language, or impossible at the moment. Thx! Link to comment Share on other sites More sharing options...
adrian Posted October 22, 2015 Author Share Posted October 22, 2015 Hi, today I was planning to use this module, there are four languages... however one is Greek [home -> pagename == gr], renaming the pagename on the Greek part is causing problems, any suggestion how to exempt the Greek language, or impossible at the moment. Thx! I don't have the option currently to exempt a particular language, but would be happy to add if that helps. But perhaps the better option would be to figure out a way to prevent the problems you are experiencing when greek is being renamed. Can you provide more details on exactly what is going wrong? 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