Copied to clipboard

Flag this post as spam?

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


  • Nick Hamlin 2 posts 92 karma points
    Apr 16, 2019 @ 16:34
    Nick Hamlin
    0

    New Component isn't showing on the page

    I'm trying to create a simple ribbon that will display a text string. I am brand new to Umbraco (certified in two other CMSs) but am having the hardest time finding any good tutorials on Umbraco so please forgive my rudimentary question. The markup for this simple component is:

    <div>
    Hello World!
    </div>
    

    Here's what I have done:

    1. Created a new Document Type under Document Types > Standard Page Components called "Hello World"
    2. Added a single tab with a single property called "Header" and saved.
    3. The components folder under the page that I want to add the ribbon to is of type "Advanced Page Components Folder" (a uSkinned page). I added Hello World to the permissions for that page.
    4. Created an item under Page>Components of type Hello World.
    5. Added "Hello World" to the Header field, saved and published.
    6. Went to the Template for "Hello World" and added the markup above and saved.
    7. Rebuilt the models
    8. Went to the page and clicked Info to get a link to the page to open in a new tab.

    The new component does not show. There is nothing in the markup that says Hello World.

    I cleared the cache. I republished the entire site. I cleared cookies. I recompiled the models. I recompiled the solution. I closed the solution and restarted VS. I restarted my computer.

    What am I possibly doing wrong?

  • Amir Khan 1282 posts 2739 karma points
    Apr 16, 2019 @ 17:48
    Amir Khan
    0

    Are you just trying to render the value of a textbox in the template? If so this is how, not the option at the top to toggle Umbraco versions, depending on what you're using.

    Basically just @Model.Content.GetPropertyValue("header") if you're using v7.

    https://our.umbraco.com/documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Textbox/

  • Nick Hamlin 2 posts 92 karma points
    Apr 16, 2019 @ 19:14
    Nick Hamlin
    100

    I guess the problem lies with the way uSkinned works. I was able to fix it by registering the document type inside uSkinned's view USN_ComponentsSwitch.cshtml.

    switch(Model.DocumentTypeAlias) {
            case Usn_Hello_World.ModelTypeAlias:
            @Html.Partial("USNAdvancedPageComponents/USN_Hello_World", (Usn_Hello_World)Model, new ViewDataDictionary { { "globalSettingsID", globalSettingsId } })
            break;
    }
    
  • Amir Khan 1282 posts 2739 karma points
    Apr 16, 2019 @ 19:17
    Amir Khan
    0

    Ah interesting. Glad you got it sorted out.

Please Sign in or register to post replies

Write your reply to:

Draft