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 17 posts 118 karma points
    Jun 29, 2020 @ 10:29
    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 17 posts 118 karma points
    Jun 30, 2020 @ 10:07
    Rowena Bellamy
    1

    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 2155 posts 14408 karma points MVP 9x c-trib
    Jun 30, 2020 @ 11:42
    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 17 posts 118 karma points
    Jul 01, 2020 @ 13:16
    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

  • Dhanesh Kumar MJ 165 posts 521 karma points MVP c-trib
    Jul 01, 2020 @ 13:11
    Dhanesh Kumar MJ
    1

    Hey,

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

  • Rowena Bellamy 17 posts 118 karma points
    Jul 01, 2020 @ 13:17
    Rowena Bellamy
    0

    Thanks D K M J!

Please Sign in or register to post replies

Write your reply to:

Draft