I have a master with some content placeholders that load content through content placeholders from either the Homepage or the regular textpages, since they differ quite a bit.
Though i have some elements that would repeat, but as of now, not so much that i can put them in the master file.
Is it possible to have a content placeholder in an existing placeholder to load content from a "mini" template?
I think that would work as long as you create a template with the master template set to the template containing the contentplaceholder.
Something like this, where the markup from your question lies in the submaster and the templates below only reflects changes in the questions contentplaceholder:
I think i would prefer that the contentplaceholder within a contentplaceholder method is achieveable since i need to include a Pliable form in the section i need repeated throughout most of the site.
It would be great if i could just add the reference to the template containing this form in the templates where it's needed. That way i only need to maintain and configure the form and its container div element from one place.
I think it should work the way you set it up above. I have a testsite with the same structure that works just fine. Any template gurus got some tips on this?
I found that if i type some text in the Questions contentplaceholder id it does output it - but i can't get the content from my Questions template to ouput the content from det contentplaceholderid in there.
Since this is an element i want to repeat on most of my site i haven't associated the Questions template (the one above) for any node, so i guess what i'm lacking is the link between the template and the homepage node? Can templates function as "stand alone" with no nodes associated?
Here's my structure:
Master - Homepage (frontpage node uses this template) - Questions (no node associated with this template and no properties defined - only contains above div and macro) - Textpage
I want this to work like the oldschool include file="" for ASP, where i can define an element, which i can insert whereever i want to, but only need to maintain one place.
Hi, sorry for the late reply. Our mail seems to go straight to my spam folder for some reason.
My templates are set up just like yours but I have nodes associated with the "Questions" template. Nodes associated with any of the parent templates of the "Questions" template will not render what you put in the "Questions" template. If you want you could probably render the content of a template using the <xsl:value-of select="umbraco.library:RenderTemplate($pageId, $templateId)" disable-output-escaping="yes"/>in an xslt macro.
Content placeholder in a content placeholder
Hi there
I have a master with some content placeholders that load content through content placeholders from either the Homepage or the regular textpages, since they differ quite a bit.
Though i have some elements that would repeat, but as of now, not so much that i can put them in the master file.
Is it possible to have a content placeholder in an existing placeholder to load content from a "mini" template?
I tried the following with no succes:
I think that would work as long as you create a template with the master template set to the template containing the contentplaceholder.
Something like this, where the markup from your question lies in the submaster and the templates below only reflects changes in the questions contentplaceholder:
- Master template
- template
- submaster
- template
-template
Hi Ernst
My structure now looks like this:
Master
- Homepage
-Questions
- Textpage
In my master i have a contentplaceholder for the content field:
The on the Homepage master i have the following:
In my "Questions template i then have this:
Which does not output the questions div. Did i misinterpret your example?
The div is defined with width, height, etc. and does show up if i insert it seperate from the contentholder.
I suppose i could just make this through a macro, but i'm actually quite keen on whether this is doable or not?
* edit * and wether it is a good idea to do it through templates and contentplaceholders instead of doing it by macros?
I think i would prefer that the contentplaceholder within a contentplaceholder method is achieveable since i need to include a Pliable form in the section i need repeated throughout most of the site.
It would be great if i could just add the reference to the template containing this form in the templates where it's needed. That way i only need to maintain and configure the form and its container div element from one place.
I think it should work the way you set it up above. I have a testsite with the same structure that works just fine. Any template gurus got some tips on this?
Hi Ernst
Could i persuade you to post the code from your testsite from the different templates, so i can compare if i made any typos or something similar?
I found that if i type some text in the Questions contentplaceholder id it does output it - but i can't get the content from my Questions template to ouput the content from det contentplaceholderid in there.
the above outputs "adaasas" but not the following content from the Questions template:
Since this is an element i want to repeat on most of my site i haven't associated the Questions template (the one above) for any node, so i guess what i'm lacking is the link between the template and the homepage node? Can templates function as "stand alone" with no nodes associated?
Here's my structure:
Master
- Homepage (frontpage node uses this template)
- Questions (no node associated with this template and no properties defined - only contains above div and macro)
- Textpage
I want this to work like the oldschool include file="" for ASP, where i can define an element, which i can insert whereever i want to, but only need to maintain one place.
Hi, sorry for the late reply. Our mail seems to go straight to my spam folder for some reason.
My templates are set up just like yours but I have nodes associated with the "Questions" template. Nodes associated with any of the parent templates of the "Questions" template will not render what you put in the "Questions" template. If you want you could probably render the content of a template using the
<xsl:value-of select="umbraco.library:RenderTemplate($pageId, $templateId)" disable-output-escaping="yes"/>in an xslt macro.
Hi Ernst
I'm just happy to get a reply :-)
Didn't know the RenderTemplate function, nice. I'll give it a go.
Many thanks for your kind assistance!
is working on a reply...