I wanted to use this immediately, so I wrapped it in a redmine plugin. There was a small trick needed, so here's the relevant code to be put, for example, in redmine_wt/lib/wt.rb and called from redmine_wt/init.rb using require_dependency.
# Dependency loading hell. http://www.ruby-forum.com/topic/166578#newrequire'dispatcher'Dispatcher.to_preparedoRedmine::WikiFormatting::Macros.class_evaldo# wiki template macrodesc"Replace token inside a template. Example:\n\n !{{template(WikiTemplatePage,token=foo,token2=bar)}}."macro:templatedo|obj,args|page=Wiki.find_page(args.shift.to_s,:project=>@project)raise'Page not found'ifpage.nil?||!User.current.allowed_to?(:view_wiki_pages,page.wiki.project)@included_wiki_pages||=[]raise'Circular inclusion detected'if@included_wiki_pages.include?(page.title)@included_wiki_pages<<page.titleout=textilizable(page.content,:text,:attachments=>page.attachments)@included_wiki_pages.popargs.collectdo|v|v[/(\w+)\W*\=\W*(.+)$/]key=$1value=$2.strip.gsub("<br />","")out=out.gsub(key,value)endoutendendend
I've not published this plugin, since it's so simple, but thought I should at least comment on this issue. Basically the above code is 90% Vianney's wiki_template.txt file, with a small wrapper based on code I saw in the init.rb of the task-board plugin by Dan Hodos.