Multiple Master Pages & Their URLs

David Speed asked on January 11, 2015 23:59

Hello,

For a project we are dealing with, we are to have two distinct master page templates. I can create a new page with a "Blank Master Page" as the template, and that allows me to create a separate master page to the site root. From there, for pages underneath I can set the "Page nesting" property on the template to be "Only the nearest master page", which will mean it only use the second master page that I've created, which is all good.

But, what I'm finding is that pages created at the root level that inherit from the root master page will have a URL like http://mysite/page-i-created-at-root-level, whereas because the pages second master page is not at the root level, any page that inherits from that master page will have a URL like http://mysite/second-master-page/page-i-created.

Is there a way to select a different master page for a site at the same level, so that the URL wouldn't be different for each page but the master could differ?

Recent Answers


Brenden Kehren answered on January 12, 2015 05:56

Technically if you are creating pages and assigning those templates to the pages, then your URLs are correct. The way around that is to create aliases for the pages you want. At any rate, I still think they are going to have different URLs.

Otherwise, get another license for another site.

0 votesVote for this answer Mark as a Correct answer

Jan Hermann answered on January 12, 2015 12:21

Hello,

yes a page alias would work, however may I know why you need to do that? Alternatively, you can leave the master page empty and then each item on first level would have its own layout.

Best regards,
Jan Hermann

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on January 12, 2015 13:26

That would work as well Jan although it sounds as if the structure the OP wants is something similar to this:

-- Site Root
--- First Master
---- First Home Page

So with that being said David, why not create your "Home" pages for the individual sections within the secondary masterpage (First Master) level? This will allow you to get the desired functionality, you just have to remember to check the "Hide on sub pages" check box on the items you don't want in the sub levels.

1 votesVote for this answer Mark as a Correct answer

David Speed answered on January 12, 2015 23:36

I think my confusion on what was required came down to my lack of understanding on how Kentico and page templates and master page templates work. I was looking at it more from a ASP.net perspective where every page can have a different master page or layout. Whereas, in Kentico, the same functionality can be achieved by simply having two separate page templates with the differing layouts that suit my needs.

Thanks for the responses.

1 votesVote for this answer Mark as a Correct answer

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