No template supporting the content type

Hi! Quick noob question here. I created a template and added “Site” as supported content.
However, I cannot choose this template when creating a Site:

Also made a couple of custom content types which I supported on another template, but these are also not avalable for selection. What am I doing wrong here?

Hi!

  • A controller is not a template (your second image shows a controller selection). Controllers are used for building templates or pages
  • A template will automatically be applied to content of its specific type
  • If you want to override this (selecting a custom tempalte), this ca be done from the top right config menu (when the page is slected).

Also, setting up a page template for the site content makes little sense, as you will only have one site content per site. Templates are only useful when you have multiple instances of a specific content :slight_smile:

I recommend going through this tutorial to learn how things are working: http://xp.readthedocs.io/en/6.12/tutorials/my-first-app/index.html

Thanks for answer! I realize that it makes little sense to create a template for the site as its used only once :slight_smile:

As you describe, I expect this to happen:

  • A template will automatically be applied to content of its specific type
  • If you want to override this (selecting a custom tempalte), this ca be done from the top right config menu (when the page is slected).

So I created a custom content type “Post” which I assigned to a template I will use for multiple posts. When I then create a new content of type “Post”, this template is not automatically applied, and does not appear in the right config menu.

What happened is that you might have designed a Page Template supporting another app’s Content Type (with the same name). Can you see which app the content type you support is from? Is that the same app that the content you created is using? Use the Detail Panel to the right to investigate more.

I am not sure how I could do that, I only have one app applied to my site also. Here’s my template with the supported content type “post”, and the dialog where I create a “post”:

And when I created this “post” content, I can see that its not using the template:

Yes, the detail panel should read “Automatic and the name of the template”. Did you actually build a page for the template you created in the first screenshot?

Yes I did, and the template is using the page. I can pick the page from the controller selection, and that works fine. I can investigate further if there’s something up with my page though.

This sounds strange indeed. Could you maybe screenshot the full view of you editing the page template?

Also, just to be precise on the terminology :slight_smile: The page is an optional part of the content item. Pages are either dynamically injected from page templates, or explicitly made from a controller (page controller) directly on the content.

Thanks for the follow up! So after a lot of testing I found the problem. My template folder has to have the content path set to “_templates”, then everything works as expected and the templates are automatically assigned to the supported content types. Change it to anything else, and it doesn’t work. Am I missing something here?