Copied to clipboard

Flag this post as spam?

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


  • Rowena Bellamy 6 posts 86 karma points
    14 days ago
    Rowena Bellamy
    0

    'IPublishedContent' does not contain a definition for 'GetPropertyValue'

    Hi guys! Really hoping someone can help me. I'm pretty pleased with myself that this is the first time I've had to admit defeat and look to you lovely folks for help! I'm building a news and events listing page in Umbraco 8, and allllllll I need to do is filter the results by my Umbraco.DropDown.Flexible doctype.

    Here is my nice simple query...

    IEnumerable

    But no matter what I simply get 'IPublishedContent' does not contain a definition for 'GetPropertyValue' back from the compiler.

    I've searched and checked the namespaces everyone else seems to suggest this might need (though these are in my View web.config anyway so even more confused), and to no avail.

    I've a feeling it's something incredibly simple, so if some kind person would like to kindly point it out (without laughing :) ) I'd be very grateful.

    Thank you !

  • Rowena Bellamy 6 posts 86 karma points
    1 week ago
    Rowena Bellamy
    0

    For anyone else finding this thread, the code works just fine if I use .Value instead of GetPropertyValue (even when querying).

    This contradicts the documentation, so if anyone would like to explain why, I'd be very grateful :)

    Thanks all.

  • Marc Goodson 1179 posts 7894 karma points MVP 5x c-trib
    1 week ago
    Marc Goodson
    100

    Hi Rowena

    The syntax for working with IPublishedContent has changed in V8 (to hopefully make it simpler to work with), and you are correct to have discovered that the new equivalent of GetPropertyValue() is Value().

    https://our.umbraco.com/Documentation/Reference/Querying/IPublishedContent/Properties/#modelvaluestring

    (which is less to type, although I still type 'GetPropertyValue' first then have to delete it, and type Value... so in a way 'more' to type :-P)

    Because they are really similar but different, and referenced everywhere in the documentation, it's still very much a work in progress to update the docs for V8 - but if you could create an issue here: https://github.com/umbraco/UmbracoDocs/issues for where you found the docs were out of date and contradictory, then somebody in the community can provide a PR to update them for future GetPropertyValuers... or you could update the example yourself and gain the 'much-coveted' C-Trib badge for your profile...

    regards

    Marc

  • Rowena Bellamy 6 posts 86 karma points
    1 week ago
    Rowena Bellamy
    0

    Thanks Marc, even after a rather frustrating Monday I'm at least reassured to know I wasn't going mad :)

    I'll raise the issue this week to save someone else's hair going grey.

    Thanks again for getting back to me so quickly - the community makes up for the documentation work in progress!

    Rowena

  • D K M J 69 posts 222 karma points
    1 week ago
    D K M J
    0

    Hey,

    Hope you identify the mistake, anyway, In v8 GetPropertyValue is Replaced with Value()

  • Rowena Bellamy 6 posts 86 karma points
    1 week ago
    Rowena Bellamy
    0

    Thanks D K M J!

Please Sign in or register to post replies

Write your reply to:

Draft