Create a master content page doctype and create 3 separate subcontent page doctypes as child doctypes; each with their own template. Then, using structure, only allow 1 of each of the doctypes under it's respective parent doctype.
The child doctypes do not need to contain any properties, they will inherit from the master content doctype
Hi Gilad, i'm writing here because you didnt publish any contact detail. in this days we are creating the first israeli umbraco user group, in tel aviv. if you want more info please follow my twitter or send me your email.
Note... you will have to override the macro execution in the child templates by wrapping the macro in a contentplaceholder in the parent template and inserting blank content for it in the child template.
Here's the layout I envision
:
Templates:
Master ContentPage Template (contains only macro in "macro" contentplaceholder)
templating issue
hello everyone.
i have some issue that i not solved.
lets say i have a 3 deffrent document types.
each one has diffrent template.
all of them has a list of sub pages of same ducoment type - lets say content page.
now.. when the user create content page in one of the document type =>
I do not want the user can choose template..
becuse if the user want to create content page under ducoment type 1 => it should be template 1.
if under ducomenttype 2 => it should be template 2.
and I do not want the user choose template 2 under ducoment type 1.
Do I have to duplicate this content page?
hope my question clear.
thanks.
maybe this will help you
http://our.umbraco.org/forum/using/ui-questions/5431-How-to-set-alternate-template-for-the-node
Assign a single template to each doctype
If each template has similar content, create a master template and place both as children, then assign a single template to the respective doctype.
Create a master content page doctype and create 3 separate subcontent page doctypes as child doctypes; each with their own template. Then, using structure, only allow 1 of each of the doctypes under it's respective parent doctype.
The child doctypes do not need to contain any properties, they will inherit from the master content doctype
hii eran.
thanks for the quick answer. (toda raba)
well... Maybe it can help..
But I thought there was a simple way to associate a page to parent template...
i guess i shoud duplicate this document type..
it could be a graet idea that pages can automatically gets parent template...
like.. lets say i have 3 template with same ContentPlaceHolder ID.
and now i want to create one template with ContentPlaceHolderId that automatically sit under the parent - ducoment type template.
thanks again. bey.
hii daniel...
that a good idea..
somthing like this:
ductype => has some propityes..
--- duc 1 => for template 1
--- duc 2 => for template 2
i guess im gonna use this!
thank you!
Hi Gilad, i'm writing here because you didnt publish any contact detail.
in this days we are creating the first israeli umbraco user group, in tel aviv.
if you want more info please follow my twitter or send me your email.
Thanks.
That's exactly the way to do it.
You could also write a macro to render a page using a specific template based on the parent document type (umbraco.library:RenderTemplate)
daniel -
It looks more elegant way to do that..
any posts , documentation or video about that?
hii eran.
really happy to hear about the first israeli umbraco user group.
I sent you a E-mail.
1. You'd create the ContenPage templates the under a master template.
2. Assign the master template as the only template for the ContenPage doctype
3. The macro would check the currentPage parent name() value (xsl:if or xsl:choose)
4. Based on parent node name(), execute the following xslt: (where $templateId is the child ContentPage template id)
5. Place the macro in the master template.
Note: you can get the template id by viewing the template editor querystring (i.e. open frame in new tab and note url)
Note... you will have to override the macro execution in the child templates by wrapping the macro in a contentplaceholder in the parent template and inserting blank content for it in the child template.
Here's the layout I envision :
Templates:
Master ContentPage Template (contains only macro in "macro" contentplaceholder)
-- ContentPage1 Template (empty content referencing "macro" placeholder)
-- ContentPage2 Template (empty content referencing "macro" placeholder)
DocumentTypes:
Doctype1 (allows ContentPage)
Doctype2 (allows ContentPage)
ContentPage (Using Master ContentPage Template)
Macro
Checks for ContentPage parent (either Doctype1 or Doctype2)
Renders ContentPage1 or ContentPage2
Thank you for your investment daniel.
I will try this later.
Meanwhile i use your first solution.
thanks again.
you helped me a lot.
No problem.. it's an investment in the community.
Let know the results... don't forget to mark a post as the solution.
is working on a reply...