Content preprocessing based on theme

Topics: Customizing Orchard
Nov 6, 2013 at 12:03 PM
Hello everyone!
This seems to be a simple question. I want to make changes to content for mobile website version, say, hide something. It's not cool to hide content by CSS, and I'd like to do it by server preprocessing. This also gives better control options.
So the question is: where in the code is a good place to take the control over the content rendering (only page content, not widgets). I'd like to write there something like this:
if (_something.CurrentTheme.Name == "Mobile")
{
 content = Regex.Replace(content, rules);
}
return content;
Where is it possible? (+ and what is the proper way to get the current theme?)
Nov 7, 2013 at 9:47 AM
Edited Nov 7, 2013 at 9:48 AM
I've found solution by my own. After creating new theme you have to create /Themes/YourTheme/Views/Content.cshtml file and make all preprocessing there like
<header>
  @Display(Model.Header)
</header>
<article>
  var modifiedContent = Regex.Replace(Model.Content, rules);
  @Display(modifiedContent)
</article>
Marked as answer by togoa on 11/7/2013 at 1:47 AM