Mark Handy
Mark Handy

Reputation: 1256

Kentico URL alias for custom page types

I've put a testimonial section together. In the CMS desk, the custom pages are kept in a folder called Testimonial. My CMS structure is like this

The url for test 2 is this: /Testimonials/Testimonial/test-2.aspx

Is there a way, without having to manual adjust the alias, to exclude the folder from the URL? So in this case it would be: /Testimonials/test-2.aspx

I'm looking in settings > URLs and SEO, but adding the folder to Exclude URLs causes issues.

Upvotes: 1

Views: 168

Answers (1)

Trevor F
Trevor F

Reputation: 1437

I'm afriad not by default. Here's some options.

  1. If you want to automate it, you can use Kentico's Global Events to catch when a document is inserted, to navigate up it's ancestor path, then create a url alias that excludes any folders in that path, and add the url alias. WIth Kentico's API, not to hard.
    1. If you just are afriad that someone will try to navigate to a folder, in the folders you can set the Properties -> Navigation behavior to "first child" so if someone DOES go to the folder url, it simply directs them down to the child (and if the child is a folder with navigation set to nearest child, it will keep going down the line).

Otherwise you would have to manually create the url alias through the Properties -> Url.

Upvotes: 2

Related Questions