Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Haansi 51 posts 150 karma points
    Dec 02, 2014 @ 01:10
    Haansi
    0

    my content page is not showing template layout ?

    I m new Umbraco and I m trying to create content pages. I have done the following steps:

    1. Added a new 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>
    
    1. Created a document type 'Content' with no custom property which uses 'uBase' as described below: enter image description here enter image description here

    2. 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 do not shows anything. Event its page behind mark up don't have anything even not a single tag.

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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 02, 2014 @ 06:15
    Jan Skovgaard
    0

    Hi Haansi

    Have you read the beginner documentation on how to create a basic website? It will guide you through the different steps required to successfully setup at website http://our.umbraco.org/documentation/Using-Umbraco/Creating-Basic-Site/

    However the issue you're facing is that your "Content" page is using the "uBase" template, which does not contain anything else than the basic elements for laying out a HTML template. Does the doctype and the , and elements not render, when you publish your content page and view the source?

    If so you just need to write something in between your tags using umbraco:Item for instance to render a field. Since you have not setup a child tempate, which inherits from the "uBase" template RenderBody() does currently not do anything.

    How you setup and use templates are very well described here http://our.umbraco.org/documentation/Using-Umbraco/Creating-Basic-Site/Creating-Master-Template-Part-1

    If you don't see anything a all when you preview the HTML source then make sure to check that the document was properly published and that under the "properties" tab of the document a template has been selected.

    Hope this helps.

    /Jan

  • Haansi 51 posts 150 karma points
    Dec 02, 2014 @ 06:48
    Haansi
    0

    Thanks @Jan Skovgaard

    However the issue you're facing is that your "Content" page is using the "uBase" template, which does not contain anything else than the basic elements for laying out a HTML template. Does the doctype and the , and elements not render, when you publish your content page and view the source?

    No nothing render, even not a single html tag.

    If so you just need to write something in between your tags using umbraco:Item for instance to render a field. Since you have not setup a child tempate, which inherits from the "uBase" template RenderBody() does currently not do anything.

    How I should use umbraco:Item in Razor, I m not using a model in this page. Even if I create a layout 'uBaseChild' inheriting 'uBase' and in Content page properteis set 'uBaseChild' as Template nothing happens, results is same on reviewing content page in its page source there is nothing. Even not Html, head or body tags. Please help.

    If you don't see anything a all when you preview the HTML source then make sure to check that the document was properly published and that under the "properties" tab of the document a template has been selected.

    enter image description here

    Thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 02, 2014 @ 07:35
    Jan Skovgaard
    0

    Hi Hansii

    What does the content of the "uBaseChild" template look like? Is it referencing the "uBase" master template?

    /Jan

  • Haansi 51 posts 150 karma points
    Dec 02, 2014 @ 08:28
    Haansi
    0

    Below is markup of uBaseChild:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage @{
    Layout = "uBase.cshtml"; }
    
    <p>It is from UBase Child</p>
    

    But on viewing content page, it do not shows anything at all. Just a blank web page which has nothing in source code.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 02, 2014 @ 08:30
    Jan Skovgaard
    0

    Hi Haansi

    That's really odd.

    What exact version of Umbraco 7 are you using? And what database are you using?

    /Jan

  • Haansi 51 posts 150 karma points
    Dec 02, 2014 @ 08:47
    Haansi
    0

    Jan Umbraco version is 7.1.6 SQL Server is 2008 R2

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 02, 2014 @ 09:12
    Jan Skovgaard
    0

    Hi Haansi

    Ok...could you try doing the following

    1: Create a new template directly under the "Templates" directory in the "Settings" section of the Umbraco backoffice and name it "Test" (Without the quotes of course :)). 2: Just write the text "HELLO WORLD!" in the template and then save it 3: Assign this template to your "Content" document type as the only template 4: Go to the content section and choose your "new page" and go to "Properties" to make sure that the "Test" template has been set 5: Save and Publish the site

    Do you see the "HELLO WORLD!" text when you browse the page?

    /Jan

  • Haansi 51 posts 150 karma points
    Dec 03, 2014 @ 02:24
    Haansi
    0

    Hi Jan,

    Its weird but I did not see anything, even in view source there is nothing. Not a single word.

    Just another point to mention, this project hacks a few Umbraco routs and render a few views from MVC controlles, is it something can effect in anyway.

    thanks a lot

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 03, 2014 @ 06:22
    Jan Skovgaard
    0

    Hi Haansi

    Ok, is there any specific reason why it's doing that?

    If you try to setup a clean installation of Umbraco does all the above then work? If so then you probably need to rethink the route hacks so Umbraco will work as well.

    Perhaps sharing the code for the hacks will make it possible for some of the other bright minds in here to figure out what needs to be changed so Umbraco functionality works properly.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft