URL Updates?

Jim Piller asked on September 9, 2019 21:33

Hello,

I have a site setup w/ the main navigation as items in the content tree located in a Menu Items Container. This is a very common way to setup navigation as the structure in the content tree won't always match the navigation. These items refer to pages in the content tree for the links that show up in the main navigation.

My question is, when I update the name of one of the pages that the navigation item refers to, it doesn't update the reference to the page in the content tree.

For example, consider that I have a menu item name "Products" and it refers to a page in the content tree located at "~/Products". Now suppose that I update the page name to "Product" (singular) and the URL updates automatically when I do that. However, my menu item still refers to "~/Products" which is now incorrect.

My question is, is there a way in Kentico to get this reference to update automatically w/ the changes in page names? If not, I would highly recommend adding this to the features list as almost every other CMS I've ever worked with does this automatically w/o any extra steps or configuration.

Thanks,

Jim P.

Correct Answer

Peter Mogilnitski answered on September 11, 2019 15:44

Create linked page - hold CTRL+SHIFT while performing drag and drop in the document tree. Create menu subfolder and drag and drop your menu items there.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Peter Mogilnitski answered on September 9, 2019 21:42

Probably instead of container page type. Create a menu folder in the main tree and use linked pages for menu items. This way the update should be automatic, because linked page represent a link pointing to another page in the content tree.

0 votesVote for this answer Mark as a Correct answer

Jim Piller answered on September 9, 2019 21:45

Hey Peter,

Thanks for the quick reply! So I would use this instead of the URL Selector field type? Is that what you're suggesting?

Thanks,

Jim P.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 9, 2019 22:00

By default Kentico should automatically create an alias for that page when you change the name. If not, check your site settings. Settings > URLs and SEO > Page URLs > Remember original URLs when moving pages. This property should be checked. Then Settings > URLs and SEO > SEO - URLs > Redirect page aliases to main URL should be checked.

Assuming those are correct, any link you have from a different location pointing to the old URL should take them to the new location.

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on September 10, 2019 16:18

I propose to use sub folder with linked documents in your tree instead of a container page type. Image Text

If you want to keep using your container page type - follow Brenden`s suggestion

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 10, 2019 17:20

If you're using a linked page, make sure you use GetDocumentURL(Eval<int>("DocumentID")) vs. GetDocumentURL() so it gets the correct page and not the linked page.

0 votesVote for this answer Mark as a Correct answer

Jim Piller answered on September 10, 2019 18:42

Hey Guys,

Thanks both for the responses, but can we back up a sec on Pete's answer? What form control do I use in the page type to select a "linked document"? It's been a while since I've built a Kentico site, so bear with me.

Thanks,

Jim P.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 10, 2019 19:10

You don't use a form control for a linked document, you're simply creating an updatable "copy" of that document in a different location. What I mean is if you have that document in 2 or more places, and update it in one of the places, all the other places update as well. So technically speaking you won't have a new page type, you'll simply use the same page type with a new location of a given page under your /Special-Pages/Menu folder.

0 votesVote for this answer Mark as a Correct answer

Jim Piller answered on September 10, 2019 21:34

ok, so how do you create that updatable copy?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 10, 2019 21:46

An "updatable copy" is a Linked Page. From the content tree, select the page you want to add the page under. In your case /Special-pages/Menu. Then click the + or Add a page. In the menu, scroll to the bottom and select "Link to an existing page". This is a linked page.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.