This project is read-only.

Tokens inside body

Topics: Core, Customizing Orchard
Oct 30, 2013 at 1:18 AM
Can we use the tokens in the Body? Does it cause performance issue? Thanks in advance.
Oct 30, 2013 at 7:23 AM
Edited Oct 30, 2013 at 7:24 AM
No you can't. But building a similar part that does take tokens may not be too difficult. Maybe a filter could do the trick too.
Oct 30, 2013 at 9:08 AM
HI BertrandLeroy, thanks for your reply. I'm not sure what the filer you mean. Could you give me more explanation or some links? Thanks.
Oct 30, 2013 at 4:28 PM
Look at IHtmlFilter, ITokenizer, and their existing implementations and usage.
Nov 6, 2013 at 12:48 AM
Is there a particular reason why tokens are not permitted in the Body part by default, Bernard? To my naïve mind it seems like a logical and powerful usage of the tokens system.
Nov 6, 2013 at 5:50 AM
Because it's never been implemented, because it's easy to implement as a third party module, because it would impair cacheability, and because tokens have not been designed as a templating engine. But if you want to do it, you are welcome to build a module. (also, my name's not Bernard).
Nov 6, 2013 at 6:17 AM
Fair enough (and apologies, it's been a long day).
Nov 6, 2013 at 6:18 AM
No problem.