Default page templates

Leo Leme asked on August 16, 2021 20:09

Hello, I'm trying to understand how the default page templates created in the Core web site are linked to specific Page Types. I've created 5 page templates in my Medio-Clinic and the just show up when I insert a page of Page Type 'Home'. Why and how does it happens, this link between the Page Types and the Default Page Templates ? Thank you

Leo

Correct Answer

Dmitry Bastron answered on August 17, 2021 06:35

Hi Leo,

Please check out this documentation article. I think there should be a filter registered in the system that only returns these available templates only for Home page type.

Within filters basically you can define this logic: which templates are available for a particular page type.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Sean Wright answered on August 19, 2021 23:18

Leo,

Dmitry is right - you need a filter to limit which templates are available for each Page. The filter lets you inspect the request context and then filter down the full set of templates to just the ones that should be available for a content manager to select when creating a page.

If you are looking for additional information about Page Templates, checkout my blog post Kentico Xperience Design Patterns: MVC is Dead, Long Live PTVC or NuGet package Xperience Page Template Utilities

0 votesVote for this answer Mark as a Correct answer

Leo Leme answered on August 24, 2021 18:51

Thank you Dmitri and Sean!

I'll sure use the default page template filters later on.

But, my problem was that I found out that only for the 'Home' Page Type, the features 'Page Builder', 'URI' and 'Navigation' were enabled. I've selected these three features for another page type 'ABC' and all the Default page templates that were showing to 'Home' page type started to show also on this 'ABC'.

Was that really the reason ? So to be able to select a Default page template, the page type has to have these features enabled ?

Thank you very much !

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on August 25, 2021 08:07

Hi Leo,

From the list you mentioned I think 'Page Builder' feature should be essential to select the template. And here are the reasons why:

  • as you may have read, Page Builder interface is iframed into CMS screen from MVC application
  • MVC templates, as well as the selection interface of the template, are parts of MVC application, therefore it could only be displayed when this content is iframed
  • this iframe is only displayed on Page tab
  • Page tab is only displayed when you select 'Page builder' feature

Other features are not important for this to work I'm pretty sure.

0 votesVote for this answer Mark as a Correct answer

Sean Wright answered on August 25, 2021 15:06

Leo,

The Page Builder feature is the only one you need enabled on a Page Type to be able to switch (select) Page templates. The other two (URL, Navigation) are unrelated.

0 votesVote for this answer Mark as a Correct answer

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