r3 - 13 Nov 2007 - 15:32:18 - MichaelDaumYou are here: TWiki >  Plugins Web > AutoViewTemplatePlugin
Tags:
development 1 Add my vote for this tag, rendering 1 Add my vote for this tag, twiki_application 1 Add my vote for this tag, , create new tag

AutoViewTemplatePlugin

Automatically sets VIEW_TEMPLATE and EDIT_TEMPLATE

Description

This plugin sets the VIEW_TEMPLATE and EDIT_TEMPLATE variables according to a corresponding form definition. So when you attach a new form to a topic, this plugin will enable the corresponding view/edit template automatically. This comes in very handy for applications where users create new topics without the help of a topic creator wizard, e.g. creating a new topic for a yet non-existing TWikiWord. Together with the appropriate application settings, this plugin will then assure that the data the user enters is handled appropriately during view and edit.

There are two modes on how the name of the template is derived:

  1. exist (default) and
  2. section.

Mode "exist"

A topic that has a MyForm TWikiForm attached to it, will be displayed using the view template MyViewTemplate and editted using the MyEditTempalte if they exist. The template name is derived by stripping off the suffix ...Form from the form name and appending ...View. The TWiki engine will then use the template name MyView to search for the correct template along the template search path, for example using a topic MyViewTemplate. Remember the engine appends yet another ...Template to the name for templates stored in topics.

Mode "section"

A topic with a MyForm will be displayed/editted using the template name stored in the named section viewtemplate/edittemplate . For example given the MyForm form definition topic contains a section viewtemplate whose only content is MyOtherView, then this will be used to view the topic. Likewise, the content of the edittemplate section in MyForm will read to find the edit template.

By default existing values for VIEW_TEMPLATE and EDIT_TEMPLATE have priority. You can override this behaviour in configure.

Plugin Installation Instructions

  • Just download the zip or tgz and unzip it into your twiki directory.
  • Plugin configuration is done via configure.
    data/TWiki/AutoViewTemplatePlugin.txt Plugin doc page
    lib/TWiki/Plugins/AutoViewTemplatePlugin.pm Plugin Perl module

Plugin Info

Plugin Author: TWiki:Main.OliverKrueger
Copyright: © 2007, KontextWork, Germany
License: GPL (GNU General Public License)
Plugin Version: 13 Nov 2007
Change History:  
13 Nov 2007: added EDIT_TEMPLATE, speed improvements, docu (MD)
29 Oct 2007: Item4904: made specification of view template skin agnostic, fixed view templates in subwebs (MD)
04 Sep 2007: Added build script and installer, minor doc changes
05 Jun 2007: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.026
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/AutoViewTemplatePlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/AutoViewTemplatePluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/AutoViewTemplatePluginAppraisal

-- TWikiContributor - 29 Oct 2007

Topic attachments
I Attachment Action Size Date Who Comment
elsemd5 AutoViewTemplatePlugin.md5 manage 0.2 K 13 Nov 2007 - 15:18 MichaelDaum  
ziptgz AutoViewTemplatePlugin.tgz manage 4.6 K 13 Nov 2007 - 15:14 MichaelDaum  
zipzip AutoViewTemplatePlugin.zip manage 6.0 K 13 Nov 2007 - 15:13 MichaelDaum  
elseEXT AutoViewTemplatePlugin_installer manage 3.4 K 13 Nov 2007 - 15:16 MichaelDaum  
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo