Sitecore CMS and everything related RSS 2.0
 Wednesday, October 05, 2005

I have added the velocity master variables replacer to the extended mail action, and put them together into one project and package.
Thanks to Jakob, adding master variables replacer is as easy as it gets now, just put your class into
<setting name="MasterVariablesReplacer" value="Sitecore.Data.MasterVariablesReplacer,Sitecore.Kernel.dll" />
in web.config and derive from default Sitecore.Data.MasterVariablesReplacer. No need to hook in the pipelines!

VelocityMasterReplacer works much like the Extended mail action. Instead of having only a few predefined macro expansions like $name and $parentName, you can now use pretty much anything accessible via the Sitecore API: $user.Name, $item.Children.Count, $item.Paths.Path, $item.Fields["Text"] and even the flow control:
#foreach($child in $item.Children)
   Child - $child.Name
#end
(Make sure that you know this before trying that trick with children)

It is also backwards compatible - after the velocity replacer does its job, it calls the base method to finish the rest.
Anyway, here's the source files - SitecoreVelocity_1.1.0.0.zip (411.82 KB). (You will need Sitecore 5.1.0.4 aka 5.1 beta1 for that)

If you just need a package - its in the /data/packages folder of the archive.

Update: sorry, link fixed.
Wednesday, October 05, 2005 3:43:41 PM (FLE Standard Time, UTC+02:00)  #    Comments [0]
Sitecore | NVelocity
Archive
<October 2005>
SunMonTueWedThuFriSat
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
Blogroll
 Alex de Groot
Few words about SiteCore from Holland
 Alexander Shyba
Sitecore Support
 Anders Dreyer
Anders Dreyer on Sitecore Development
 Jakob Christensen
Sitecore Core Development
 Lars Fløe Nielsen
Lars's ramblings about development and business processes
 Ole Thrane
Sitecore API
 Runi Thomsen
Runi Thomsen Sitecore Toughts
 The Sitecore Experience
The Sitecore Experience
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010
Alexey Rusakov
Sign In
Statistics
Total Posts: 211
This Year: 0
This Month: 0
This Week: 0
Comments: 0
Themes
Pick a theme:
All Content © 2010, Alexey Rusakov
DasBlog theme 'Business' created by Christoph De Baene (delarou)