Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Default page template: ad-hoc View modes: 
User avatar
Member
Member
pavel.1991-tut - 5/13/2013 9:55:27 AM
   
Default page template: ad-hoc
I've created my own document type. Now when I create any new document using this document type, my new document inherits parent's page template, but I want that any new document have ad-hoc page template. In properties of my document type I did not find how to set that new documents have ad-hoc page template by default. What should I do?

User avatar
Member
Member
pavel.1991-tut - 5/13/2013 10:05:29 AM
   
RE:Default page template: ad-hoc
And maybe I can somehow to set, that this document type use my page layout? I mean that when I create new document, it would have ad-hoc page template and this ad-hoc page template would use my page layout.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 5/13/2013 11:48:44 AM
   
RE:Default page template: ad-hoc
Technically you can't select an ad-hoc template as a default template. If you go to your Document Type and look on the general tab, in the New document settings you can select a Default page template.

if you wanted to create a custom page for the New Page, there you could create an ad-hoc template in code behind, but you'd have to code all that vs. using out of the box functionality.

User avatar
Member
Member
pavel.1991-tut - 5/15/2013 8:40:56 AM
   
RE:Default page template: ad-hoc
Technically you can't select an ad-hoc template as a default template

But when I create new document using "menu page" document type, there appear new document with ad-hoc page template.

if you wanted to create a custom page for the New Page, there you could create an ad-hoc template in code behind, but you'd have to code all that vs. using out of the box functionality.

I will try to explain what I need. I want to create document type. When I create new documents using this document type, I need that each new document have its own ad-hoc page template. Moreover, if it is possible, I want that each new document have page layout which I choose by default.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 5/15/2013 9:00:29 AM
   
RE:Default page template: ad-hoc
pavel.1991-tut wrote:
But when I create new document using "menu page" document type, there appear new document with ad-hoc page template.

As I said, you cannot select an ad-hoc template. They (ad-hoc) are assigned by default.

You're confused on the functionality of a Menu Page and other document types. Techincally they are all document types but say you have a page (cms.menuitem) that displays a list of the News document type in a repeater. If you continue to add the News docs nested below the News page the News docs will inherit the News page template unless you specify otherwise. You can do this in Site Manager>Development>Document Types>select one and in the new document settings area, select a default page template.

User avatar
Member
Member
pavel.1991-tut - 5/15/2013 9:59:55 AM
   
RE:Default page template: ad-hoc
Just do not be angry but I can not understand one thing.
You say that ad-hoc templates are assigned by default. I created new document type and then I created new document using this document type. Now this new document in its properties inherits parent's document page template. Why? You said that there must be ad-hoc by default.

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 5/15/2013 12:23:42 PM
   
RE:Default page template: ad-hoc
pavel.1991-tut wrote: Just do not be angry
I'm not angry, simply helping and restating what I mentioned already.

pavel.1991-tut wrote:
You say that ad-hoc templates are assigned by default.
I was wrong with this comment. They are only assigned by default if you choose a blank page or blank page with layout when creating a new page. See the image below:User imageIf you choose "Use existing page template" the page will use that template you select (note you cannot select any ad-hoc template pages). If you choose "Use parent page template" the page will use the parent's defined template (ad-hoc or otherwise). If you choose "Create a blank page with layout" this option will create an ad-hoc template as will "create a blank page".

What I do when creating a new page (menu item) is if I don't have a template setup already I will create a blank page with layout and immediately create a new template in the page properties.

Again, it comes to understanding document types and how they work. I still think you may be confused on the "page" document type and your custom document type. The "Page" (cms.menuitem) document type acts like a page and uses page templates. Whereas with your custom document type or News or Article document type, they by default inherit the parent page template, UNLESS you specify it in the document type itself.

My suggestion for you would be to create a Page, then nest your custom document types below it and display them in a repeater. You'll see how easy it is to get things to work. Your transformation dictates how the items display on the page.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/16/2013 1:10:26 AM
   
RE:Default page template: ad-hoc
Hi,

Just to add my 5 cents

The above is correct. Basically the main difference in the Page Menu Item document type is that this type has specified the "New page" setting - in the document type definition in Site Manager. If you want to have it for other document type - you can do it as well - you can even specify your own custom page with the logic you need.

Best regards,
Juraj Ondrus