Got that.
Option 1, easy: use Freemarker eval
In dialogs, enter something like "model.getItemPrice(123)" and then with 
Freemarker use content.property?eval
Option 2, more challenging (but funny!): use AngularJS or similar
In dialogs, enter something like "{{item[123].price}} (or similar!!) and with 
AngularJS (or whatever you want) inject the logic to retrieve price in JS world.

HTH, 
Matteo

-----Messaggio originale-----
Da: [email protected] [mailto:[email protected]] 
Per conto di Violetta Baeva (via Magnolia Forums)
Inviato: lunedì 16 febbraio 2015 11:43
A: Magnolia User List
Oggetto: [magnolia-user] Static Field with dynamic values

Hello, 

Does anyone know how to extend existing Magnolia classes (and which of them) to 
be able to preprocess static fields and replace special tokens with their 
values?

For example if we have a value "Price from {item.123.price}" then a token 
{item.123.price} will be recognised, a corresponding method will be called 
(getItemPrice(123)) and the token will be replaced with its value

"Price from £15" will be display to the final user on the website.

Thanks!

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=00c464be-612a-4b52-88d4-d700b577d494


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------



----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to