Patch #3806

Template engine

Added by Dmitry Chernyak about 12 years ago. Updated almost 4 years ago.

Status:NewStart date:2009-09-02
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Wiki
Target version:-

Description

I just wrote the simple template engine:
You must create a project with id "templates".
Next, when you'll create the new wiki page, if page with such name can be found in templates/wiki, it will be used as template.

I using it to write SLA for projects.

The changes is in the
lib/redmine/wiki_formatting/textile/helper.rb
(one function)

        def initial_page_content(page)
          @wtempl = Project.find("templates")
          pname = "#{@page.pretty_title}" 
          @templ = @wtempl.wiki.find_or_new_page(pname)
          if @templ.new_record?
          then
            "h1. #{@page.pretty_title}" 
          else
            @templ.content.text
          end
        end


Related issues

Related to Redmine - Feature #2674: wiki templates New 2009-02-05
Related to Redmine - Feature #6989: Wiki template for version wiki pages New 2010-11-26

History

#1 Updated by Sergey Gribnyak almost 4 years ago

Is this worked for redmine 3.3.2.stable ?

#2 Updated by Toshi MARUYAMA almost 4 years ago

  • Description updated (diff)

#3 Updated by Sergey Gribnyak almost 4 years ago

As I can view: no.
- I changed the lib/redmine/wiki_formatting/textile/helper.rb;
- create templates/wiki/MyTest page;
- restart redmine;

New wiki pages with "MyTest" name does not contain relevant content. What do I need to do to make this solution work?

Also available in: Atom PDF