-
-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copying page in Admin makes resulting page have same slug #394
Comments
What you suggest, adding |
Hi Flavio, I think we want to make it align with the current naming scheme logic, which seems to be using a " - #" format where # is either 2 or adding 1 to the existing value. So, let's say there is a page called "New Page" and we make a copy. Here is what I would expect: Copied page
What do you think? Thanks very much, |
👍 sounds good! |
…ing a copy of the page Does not change the page title, just the page route property if set in the header, to avoid two pages with the same slug / route / raw route.
Created a PR to solve this. Works at the basic level, still need to test with multilanguage and edge cases. |
Doing final tests to merge this |
…ing a copy of the page (#537) Does not change the page title, just the page route property if set in the header, to avoid two pages with the same slug / route / raw route. Handles ordering too, and pages with custom slug. Independently updates the slug and the folder name.
Fixed by #537 |
@paulhibbitts give it a try when you have time, just to make sure there are no issues I didn't find |
This is really awesome @flaviocopes! I've been able to do some testing and looks like a winner 👍 This is a perfect way to blow the mind of a WordPress person... 'you can even have two or more blogs in one Grav site, look it's so easy just a simple page copy and you're done.' 😉 |
So everything is working really nicely, but I think there will be less possible user confusion if the new title of copied pages is also updated. For example, I have a page called ‘My Apple’ with the slug ‘apple’. After making a page copy I have ‘My Apple 2” with the slug ‘apple-2’. Another example is that I have a page called 'Home' with the default slug 'home. After making a page copy I have "Home 2" with the slug 'home-2'. |
Should now be fixed in develop. Copy "Test", the title is "Test 2". Copy "Test 2", the new title is "Test 3", and so on. |
Thanks very much Flavio. I did some tests on noticed one issue: If you start with 'Home' and make a copy you get 'Home 2' and 'home-2'. Make a copy of that and you get 'Home 3' and 'home-3' - perfect :-) However if you at this point make another copy of 'Home 2' you get a page named 'Home 3' but with the right slug 'home-4'. Here is a snapshot: If the name # could match the slug # then I think it's good to go. Thanks again, |
I did this on purpose - the slug must be unique, the title does not. The usage most likely is to copy a page one time, so you get its title + "2". If you want to copy it again, you'll get the page title + "3", but it's unlikely you'll keep the title the same on all pages. |
Sounds fine, thanks. It is a more extreme use case I am testing with - as you say more likely to copy one page at a time and then change page names too. Great to have page copying working even better in the new Admin Panel 👍 |
When copying a page the slug of the new page does not seem to get changed, and is the exact same slug as the original page which then causes various issues.
I've attached a screenshot, look at the new copy folder name field vs. slug field.
To repeat issue:
Thanks very much,
Paul
The text was updated successfully, but these errors were encountered: