1
votes

I'm creating a content page in Umbraco and for that I have created a document type and a template. But the content page do not show any mark-up, it just shows an empty page.

Please help me. Below is my code and description of steps:

  1. Created a template uBase

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = null;
    }
    <!DOCTYPE html>   
    <html class="no-js nonlegacyIE" lang="en">  <!--<![endif]-->
        <head>          
        </head>
        <body class="@ViewBag.BodyTagClass">
            @RenderBody()         
            @RenderSection("Scripts", required: false)
        </body>
    </html>
    
  2. Created a document type Content with no custom property, it uses uBase as described below:

    enter image description here
    enter image description here

  3. Next I m just creating a content by clicking Content > CREATE AN ITEM UNDER CONTENT > Content.

Issue is when I publish and preview this page it does not show anything. Even its page behind mark-up doesn't have anything, not even a single tag.

Please help I have spent much time but still no luck :(

EDIT: Here is my content page properties: enter image description here

1
Can you show a screenshot of the properties tab of the created content page please? Specifically, i'm looking to make sure the URL has generated correctly, the template is selected and that the content node has the right document type.agrath
Also, flip your compilation debug flag to true and use ?umbDebug to view the mini profiler as per this forum post our.umbraco.org/forum/umbraco-7/using-umbraco-7/… - it may provide a clue as to why the page is not rendering.agrath
@agrath thanks, please see my edit.user576510
well i'd start by removing: <!--<![endif]-->Jimbo Jones
also if you are using the uBase template there is no need for: @RenderBody()Jimbo Jones

1 Answers

0
votes

From my understanding, what you've done is render a Master Page.

RenderBody() goes to the master page to tell it basically: "hey, this is the part where you render the body of each page that has

Layout = "YourMasterPageName.cshtml"

on top.

So remover RenderBody and try to output each textfield with something like this:

@Model.Content.GetPropertyValue<string>("YourPropertyAliasHere")

You're basically mixing the MasterPage and an actual View.

here's the documentation on how to Use Umbraco with cshtml Views to output content:

Master Page Tutorial

Output a textbox property editor

I can elaborate more if you'd like, just let me know.