Copied to clipboard

Flag this post as spam?

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


  • Anthony Dang 1404 posts 2558 karma points MVP 2x c-trib
    May 23, 2013 @ 18:07
    Anthony Dang
    0

    Changing the output of GetPropertyValue and/or Umbraco Item

    Random question.

    Is there any way to change the result of GetPropertyValue() and/or <Umbraco:Item /> ?

    I know the cache is stored in memory, so how does one modify property values of this in-memory cache?

     

  • Stephen 767 posts 2268 karma points c-trib
    May 23, 2013 @ 18:15
    Stephen
    0

    What version of Umbraco?

    What do you mean by "change the result"? What GetPropertyValue returns comes from the XML cache, via the property value converters. So I guess what you want is create a converter for a property, but I'm not sure I understand what you're actually trying to do...

  • Anthony Dang 1404 posts 2558 karma points MVP 2x c-trib
    May 23, 2013 @ 18:36
    Anthony Dang
    0

    heya

    I want to to do Model.pageTitle or node.GetPropertyValue("pageTitle"), or <umbraco:Item Field="pageTitle"/>

    eg. if the cache for pageTitle is "my page title", I want to change that in memory to "my awesome new page title", so that Model.pageTitle will have the result "my awesome new page title"

     

     

     

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    May 23, 2013 @ 19:15
    Jeroen Breuer
    0

    I once wrote some code where I got the xml from cache and updated that. Than I converted the updated xml to a DynamicNode. In this example I add an extra element, but you could also use it to change existing properties: http://our.umbraco.org/wiki/reference/code-snippets/add-fake-property-to-a-content-node

    I don't know if this can also be done for IPublishedContent.

    Jeroen

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies