[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
anthony_sales1
Community Member

I have to say this is a real bugbear for me - this is a flaw or a bug - not a feature request - it makes absolutely no sense for internal links to internal pages to break when you change the name - given that this does not happen for any other objects in canvas e.g. assignments, quizzes etc - I can think of no scenario in which a user would want links to an internal content page to break when the name is changed. In fact all that is required is a simple script which runs when you change the name of a page - this checks for any internal links to the page and changes the name if found...

The fact they are aware of this and have said they have no intention of fixing it anytime soon speaks volumes about their attitude to user needs. In fact I think this issue is such a flaw, unless it is fixed I really won't be able to support a renewal of our contract when it expires... Smiley Sad

For example - I have just created a new course from our template - updated all of the unit/page names and now there are 511 broken links which I have to go through manually and change...

anthony_sales1
Community Member

Well their standard defense is that that have to use the page names as URL's for accessibility purposes (they use this excuse often) - which is nonsense for two reasons - firstly none of the other objects in canvas follow this URL naming procedure e.g. quizzes, assignments etc, and secondly even if they insist on using the page name as the URL, there is simply no need for internal links to it to break on a name change - it would be a simple script job... Don't hold your breath they haven't updated the page editor etc for 8-9 years - apparently page content is not a priority, and what they really want to do is sell you another expensive add-on...

lph
Community Champion

This has bitten me several times this past year. Pretty URLs aside, as someone pointed out that assignments can be renamed. I'm almost to the point of putting more content in assignments than pages. This way I can change names.

Here is a neat trick:

On the pages list, click on the kabob (more option, 3 vertical dots) and hover over Share to Commons. A link will show in the bottom left corner of the browser. The last part of the link with be a series of numbers which are equal to the page ID.

Once you have the page ID then you can link. Here is a sample:

/courses/7465/pages/4518‍‍‍

What I've tested:

The page name can be changed and the link still works.

What I haven't tested:

Copying the course page to another course. Since the page ID is changed then I'm not sure if this link is updated. I'll update this post once this has been tested. Feel free to tinker with it yourself. 

Update: The copy process changes the link from the page ID to the name of the page (for the new course). If you use a master shell, and make a copy of this master shell then it looks like you'd not want to make changes in it, and stick to making changes in the master shell.

James
Community Champion

lph,

 

Here is another way to get the page ID that will work even if someone doesn't have access to Commons.

  1. Open the content page that you want to find the ID for in the browser. You do not need to edit it, just open it.
  2. Open the browser's developer tools by pressing the F12 key.
  3. Switch to the Console tab of the developer tools
  4. Paste ENV.WIKI_PAGE.page_id into the console and press enter (you may have to hit enter twice). Note that with recent versions of Chrome, you don't even have to press enter for it to show the result.

If you have a lot of these to do, you can leave the developer tools open as you navigate the pages. You can also hit the up arrow key to bring up the console history and repeat the command.

lph
Community Champion

Excellent idea.

anthony_sales1
Community Member

Thanks for the tip about the numbers and testing it with a course copy, but if I can’t copy the course it defeats the object of changing the links – the fact that links break is still a massive bugbear… ☹

anthonem
Community Contributor
Author

Thanks Layne! So, there is a page ID, but it doesn't "stick" on course copy. Ugh! So frustrating. 

lph
Community Champion

Hi  @James ‌

Have you considered a tool that would rapidly change all page links from pretty URL to page ID?

There is a course of mine with hundreds of pages and internal links (big mistake!). If the links can be changed from ID to pretty URL during course copy then maybe the opposite is true. This would allow development of pages to be faster. 

As an aside, I suspect Canvas developers have never been bitten by this issue. It’s a huge time waster. If ID can be used for assignments then it can (and should) be done for pages. 

James
Community Champion

lph,

No.

The conversation around this says that when you copy a course, the pageID doesn't stick. That would make it less usable than a pretty URL.

Besides, I've always liked looking at the URL to know what page I was going to rather than just page 8249. It instills more confidence that you're not just headed to some random page.

I am actually opposed to changing the links automatically, but I see where some people would benefit from that option. When I was first starting off, I was bitten by lack of planning on my part and wished for that feature. Now I try to think a little before I create pages so it's not such a big deal. My name changes now happen before I link or because I want to move an old page out of the way to make room for a new page with the same name.

rpayne4
Community Participant

Is there any fix that people have found that can be shared with teaching staff? The ID fix that people have been discussing in this thread is great but hard to teach teaching staff who aren't as tech savy to use.
Another solution to the problem being addressed in this idea could be a site wide switch in the admin controls that just flips page urls from operating on names to page ids?