Copied to clipboard

Flag this post as spam?

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


  • lele 107 posts 444 karma points
    Mar 05, 2015 @ 14:37
    lele
    0

    No value with GetVortoValue()

    I need your help!

    I have no value in a child page if a try to get a vorto text string.

    I tried:

    @item.GetVortoValue("title") --> empty String

    @item.title --> Our.Umbraco.Vorto.Models.VortoValue

     

    some ideas how to get the text string value?

    thx&best regards
    manuel

     

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 05, 2015 @ 15:53
    Alex Skrypnyk
    0

    Hi Lele,

    Did you check value in current culture in the CMS ? Is 'item' IPublishedContent type ?

    THanks

  • lele 107 posts 444 karma points
    Mar 05, 2015 @ 16:05
    lele
    0

    Hi Alex

    Thanks for your answer. 

    1. Yes i have two languages added and check it with the currnet culture name. this is working.
    2. Yes it is IPublishedContent

    best regards,
    Manuel

     

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 05, 2015 @ 16:08
    Alex Skrypnyk
    0

    AS I see at source code : https://github.com/mattbrailsford/Vorto/blob/master/Src/Our.Umbraco.Vorto/Extensions/IPublishedContentExtensions.cs

    This method is pretty straightforward, it looks like the problem with data from Umbraco.

    Thanks

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 05, 2015 @ 16:29
    Alex Skrypnyk
    0

    Try to check with HasVortoValue method.

  • Volodymyr 5 posts 26 karma points
    Jun 16, 2015 @ 10:15
    Volodymyr
    0

    Hi

    I'm a Umbraco newbee, first time using Vorto.

    I have the same issue - no value returned by GetVortoValue and HasVortoValues methods. I've found this error in the umbraco log:

    ERROR Umbraco.Core.Dynamics.DynamicInstanceHelper - [T132/D9] An error occurred finding and executing extension method "HasVortoValue" for type "Umbraco.Web.Models.DynamicPublishedContent". Types searched for extension methods were Umbraco.Web.Models.DynamicPublishedContent. System.MissingMethodException: Method 'Umbraco.Web.Models.DynamicPublishedContent.HasVortoValue' not found.

    The vorto package installation was successfull. I've restarted the site. That does not help.

    My template is:

    @foreach(var category in CurrentPage.Children) 
    {
        <div class="content equal">
        @if(@category.HasVortoValue("categoryNameVorto"))
        {
                 @category.GetVortoValue("categoryNameVorto")
        }
        </div>
    }
    

    Please advice what is wrong there. Any help is very appreciated.

  • lele 107 posts 444 karma points
    Jun 16, 2015 @ 10:23
    lele
    0

    did you extend your partial view with

    @using Our.Umbraco.Vorto.Extensions
    

    ?

    /manuel

  • Volodymyr 5 posts 26 karma points
    Jun 16, 2015 @ 11:47
    Volodymyr
    0

    Thanks, Manuel

    I don't use partial view for that page - I'm just modifing a document type template. I've added that using as you adviced to the very top of my template. Unfortunately that did not solve the issue - I'm still getting that error in log and no values at the page.

    I believe the reason of issue is very simple but I can't find it out yet.

    Please help.

  • lele 107 posts 444 karma points
    Jun 16, 2015 @ 12:06
    lele
    2

    GetVortoValue is only working with strongly typed Content (IPublishedContent) and not dynamic content... like CurrentPage

  • Volodymyr 5 posts 26 karma points
    Jun 16, 2015 @ 12:10
    Volodymyr
    1

    I've casted my page to the IPublishedContent - and now it works! :)

    Thank you very much Manuel!

  • lele 107 posts 444 karma points
    Jun 16, 2015 @ 12:11
    lele
    0

    your welcome :)

Please Sign in or register to post replies

Write your reply to:

Draft