[Pages] ALL links when Page name changes

This idea has been developed and deployed to Canvas

Here's a common scenario:

 

An instructor makes a page, let's say a module overview page, and then links to this page from a custom Home page. While developing the course, the instructor changes the name of the module overview page. This breaks the homepage link because the page URL contains the page name.

 

Please create a system to avoid this common problem.

87 Comments
Renee_Carney
Community Team
Community Team

Have you tried using the content linking tool (located to the right of the page or content you are editing) rather than the URL to link to your page/content?

ewingj
Community Novice

The content linking tool might help faculty keep things straight, if they learn it, but I think that a permalink structure would be much more effective from a student perspective. Links are passed around often, and sometimes bookmarked outside of Canvas, so it would be nice if they never changed. While I generally lean towards a friendly URL structure, in this case I think it might make more sense to give each page an ID, as is done with Courses and Users.

anthonem
Community Contributor
Author

Hi  @Renee_Carney ,

Unfortunately the link still breaks, even if added with the content linking tool. Here's some evidence.

anthonem
Community Contributor
Author

Thanks  @ewingj ​. You're right I hadn't even thought about the people that bookmark Canvas pages - that's a great point!

Renee_Carney
Community Team
Community Team

Great!  Wanted to make sure we had all information collected.  It helps inform voters!

kona
Community Coach
Community Coach

 @anthonem ​, is completely correct! It don't believe it was always like this, but it has been for a while. I know for me personally it was extremely frustrating when I was building my new summer course. Sometimes when I start building a course a page name makes sense, but the further I get I realize it needs tweaked. As it is right now I have to remember everywhere I've linked to that page from and go back and update all of the links. sadpanda​

James
Community Champion

I'm sure someone else has already written a tool to rename the links and it's way cooler and even finished, but I'll go ahead and share my experiences. This is similar to a feature request I had put in the old community, so I'm generally on board with it and this is not meant to diminish, just share work-arounds until something easier becomes available.

As an instructor, being aware of the issue had made me focus more on the names before I start linking them. Every now and then, I forget or decide I really didn't like a title, but having to manually change all the links has definitely helped me create better names in the first place.

Having an "incoming links" or "what links here?" or a "graphical site map" for the pages would be even nicer so that we knew which pages needed changed.

But I'm also a technologist and work with API calls. When  @kona ​ was bemoaning that fact that the links to the guides had changed (back when it first came out), I took an evening and wrote a program that would 1) obtain a list of all pages, 2) look for URLs matching a pattern, 3) replace the URL by the new one, 4) optionally replace the link text by the new name of the page if it was the default name of the old page, and 5) update the page in Canvas. I had to use a DOM parser, so I cleaned up some clutter (like the evil   and semantically incorrect empty paragraph tags, especially at the end of the document), and I discovered several places where Canvas's content link took generates invalid HTML like empty id attributes and pointless HTML like empty class attributes.

I never finished the code, the teacher is the #1 job and takes priority, but I did get it to the point where we did testing and discovered that URLs could be entered multiple ways. I also generated a list of pages with parsing errors so they could be fixed. I went through and fixed the errors on the pages and the code worked in testing, but it was a live course in use by thousands of students and so I never ran the code on the whole thing. Then Canvas decided to make the old links still work after June 30, and the issue mostly became academic.

The point of all this is that you can, through programming and the API, go through and change all of your links when you rename a page. The problem is that it's not integrated with Canvas, so you would have to specify the old page name and the new page name. That's where they awkwardness, not user friendly, definitely for a programmer aspect comes in. Even though I've got the capability, it's still easier for me to manually go through and change the links.

You could also use it to prepare a list of all of the links that you contain in your pages. Theoretically, you could incorporate some kind of link checker on those as part of the process, but I wasn't that worried about at the time since the links I was changing had all been automatically collected from the new guides).

But, back to this issue. There's one concern I have (not saying I won't have more later). If I want to rename a page but have the links continue to point to the same place because I'm going to replace the page with new content, then automatic relinking with a title change is bad. And yes, there are times I've done that. I've started off with a page being one thing and then it morphed into something else before I was done. I wanted to change the name and then make a different version of that page. Had I linked it already to things, it would have messed things up.


I said concern, not show stopper. I could copy the existing, morphed content, and put it in a new page. Then deleted all of the content on the existing page, and recreated it.

If you do an automatic relinking, have an optional checkbox, checked by default is fine, to relink all pages when the title is moved.

Except, that's not the way page renames work and putting it in there would clutter what is a simple process with an unnecessary checkbox.

Perhaps there could be a history of page name changes asking which ones you wanted to rename? Again, clunky.

Maybe a pop-up that says "Hey, you're changing the title of this page, would you like to go through and rename all the links as well?"

The permalink idea has some merit, but what if you really want to rename an old page and replace it with a new one. The permalink would take you to the old information, rather than the new one. As for what  @ewingj  said, every page does have an ID. It's not documented in the Pages API documentation, but one of the fields returned when you get a list of pages or a single page is page_id. The main difference is that it's not used in any of the API calls the same way that other IDs are -- pages are keyed off the URL.

Anyway, I just thought I'd share some of what I've tried or been forced to do related to this issue.

scottdennis
Instructure
Instructure

This feature idea is now open for voting.

SKMladenovic
Community Novice

I'm sure that in previous versions this was not an issue and links were auto-updated. I vividly remember how baffled I was the first time I came across the problem. It doesn't help that when clicking to edit a page, the text insertion point defaults immediately to the title of the page, rather than within the page itself. This has been the primary cause of "my page has disappeared!" calls for help.

teri_wright02
Community Novice

This would be a great feature update. For new Canvas users, you usually find out the hard way that the link breaks after renaming a page.