Copied to clipboard

Flag this post as spam?

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


  • Luís Costa 26 posts 148 karma points
    Aug 11, 2017 @ 17:37
    Luís Costa
    0

    Hello,

    I update my template and my umbraco version and now umbraco cannot print the content of alias.

    enter image description here

    Anyone knows why?

  • Nik 1591 posts 7148 karma points MVP 6x c-trib
    Aug 11, 2017 @ 21:00
    Nik
    0

    Hi Luis,

    In line 27 you are accessing a property by doing Model.PropertyName, however in line 28, you are doing @Model.Content.GetVortoValue.

    Can you explain what Model is because using two different approaches seems quite strange?

    Can you show where the Model is defined in the view please?

    Thanks,

    Nik

  • Luís Costa 26 posts 148 karma points
    Aug 11, 2017 @ 23:07
    Luís Costa
    0

    Hi Nik,

    Yes, this image is from the same document.

    Then i try to use vorto tag like Nicholas said @Html.Raw(Model.Content.GetVortoValue("teste"))

    And finally i receive this error when i try to use vorto

    enter image description here

    Thanks!

  • Nik 1591 posts 7148 karma points MVP 6x c-trib
    Aug 11, 2017 @ 23:12
    Nik
    100

    Ah, okay. Because your view inherits from UmbracoViewPage you don't need the Content part to access the properties. You should just be able to do Model.GetVortoValue instead.

    Give that ago.

  • Luís Costa 26 posts 148 karma points
    Aug 11, 2017 @ 23:22
    Luís Costa
    1

    Hello!

    Finally this works!

    Like you said, Model.GetVortoValue but i have to put like this

    @Html.Raw(@Model.GetVortoValue("teste"))

    If i use Model.Content.GetVortoValue this wouldn't work because according to the visual studio i'm trying to access to a protected class.

    Thanks!

  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Aug 11, 2017 @ 21:07
    Nicholas Westby
    1

    In addition to what Nik mentioned, I'd add that this line has an extraneous at sign:

    @Html.Raw(@Model.Content.GetVortoValue("bodyText"))
    

    Instead, remove that at sign:

    @Html.Raw(Model.Content.GetVortoValue("bodyText"))
    

    Perhaps that's not your issue here, but that at sign is certainly not necessary and could potentially cause issues.

Please Sign in or register to post replies

Write your reply to:

Draft