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...
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"
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?
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...
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"
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
is working on a reply...