How to use a template without input data in the content page
Hi
I am trying to adding a sub page in the content area but dont want to input the content in the Content/Section Content area but would like to use a template which will have all the html code. Is that possible and which way?
Thanks in advance!
Hi Marc
Thanks for the help.
That is exactly what I did, but didn't work. That is I cant see my page section (template with the html) in my subpage.
I wonder do I need to RENDER the section template somewhere in the subpage template, as like as we render partial view in template?
One more thing, to make it more clear, right now I am using @item.PageContent to get the sections in the subpage. But the thing is I want to move this part and want to have html separate in many sections, so that I can just put them in the subpage instead of putting things in the page content (in the content section).
The current code which loops through the all sections and render the subpage sections looks this:
var selection = Model.Content.Site()
.FirstChild(x => x.Id == CurrentPage.Id)
.Children
@foreach(var item in selection){
<section class="wrapper @item.SectionClass">
@item.PageContent
</section>
}
what can be used to get the sections here in the loop instead @item.PageContent ?
Thanks
How to use a template without input data in the content page
Hi I am trying to adding a sub page in the content area but dont want to input the content in the Content/Section Content area but would like to use a template which will have all the html code. Is that possible and which way? Thanks in advance!
Go to Settings > Templates in the Umbraco CMS and then create a new template.
Paste all of your static HTML directly into the template.
Go to Settings > Document Types
Find the Document Type that controls your sub page.
Choose Templates, top right of screen.
Add your new template as an option.
Go to Content and open your sub page.
Go to the properties tab and select your new template from the 'Template' dropdown.
Save and publish and your page will now use this template.
Hi Marc Thanks for the help. That is exactly what I did, but didn't work. That is I cant see my page section (template with the html) in my subpage. I wonder do I need to RENDER the section template somewhere in the subpage template, as like as we render partial view in template?
Thanks a lot!
One more thing, to make it more clear, right now I am using @item.PageContent to get the sections in the subpage. But the thing is I want to move this part and want to have html separate in many sections, so that I can just put them in the subpage instead of putting things in the page content (in the content section). The current code which loops through the all sections and render the subpage sections looks this: var selection = Model.Content.Site() .FirstChild(x => x.Id == CurrentPage.Id) .Children
what can be used to get the sections here in the loop instead @item.PageContent ? Thanks
is working on a reply...