MVC Layout: Custom Module and Canonical URLs

Posted by bwilson on 10-Sep-2019 17:21

Hello! I have a custom module in my Sitefinity 10.2 project that contains our employee directory. I've made layouts for the MVC list and detail views. I've placed the the widget (default one generated by SF) on Page1. I set the "Detail" view to link to a specific page - Page2, which is a child page of Page1 - dropped the widget on the page and picked the proper template for the detail view. Everything works fine except for the canonical URL on Page2. I was expecting:
http://www.mydomain/Page1/Page2/employee-name

Instead, I'm getting:
http://www.mydomain/Page1/employee-name - which doesn't function properly since I do not want to show the individual's listing on this page.

This seems like incorrect behavior to me. Is there a way to get the canonical URL to reflect the actual page the content resides on?

Thanks,

Beth

All Replies

Posted by jread on 10-Sep-2019 17:48

You need to set the default location for the content. In the backend go to:

- Content > Employees

- In the right column click "Pages where items like this are published" (or if using new UI click the settings icon first top right)

- Move the page you want as the default location to the top of the page

Posted by bwilson on 10-Sep-2019 18:01

Wow. I never would have thought of that. Feels very unintuitive to me. Thank you!

This thread is closed