Is there a way to have razor parsing page content body before inserting it in template and generating final html

Topics: Customizing Orchard, General, Writing modules, Writing themes
May 29, 2013 at 12:08 PM
It would be nice to be able to insert some placeholders in the html we entre for body of any content (manly pages).
something as
'@Url.LocalImg(WorkContext.CurrentTheme,"content/about_slide1.jpg")' which would call my extension to finalize the image path ?

May be this is already existing and I missed it ?
Developer
May 29, 2013 at 12:16 PM
There's a module on the gallery that provides a RazorPart: https://gallery.orchardproject.net/List/Search?packageType=Modules&searchTerm=razor
May 29, 2013 at 12:40 PM
Edited May 29, 2013 at 12:41 PM
Thanks I will give a look, in the same time I have found one of your great blogs about parsing emails body written for razor syntax.
Developer
May 29, 2013 at 1:47 PM
Which reminds me I still have to write part 3. :) But yeah, part 2 contains useful info which you could take and create your own RazorPart if need be.
May 29, 2013 at 1:53 PM
In fact, I said razor, but for 90% of my needs I would just be interested in something definitely lighter, just allowing to automatically generate img's src paths according current theme....may be just a string.replace in the body display template ???
Developer
May 29, 2013 at 1:55 PM
Then maybe look at implementing an IHtmlFilter?
May 29, 2013 at 2:34 PM
I don't know what it is :) but will do a search. Any pointer ?
Developer
May 29, 2013 at 2:42 PM
Look for its usages, you'll quickly see what it's good for. :)