exist
(default) and
section
.
MyForm
WikiForm attached to it, will be displayed
using the view template MyView
and editted using the MyEdit
if they exist. The template name is derived by stripping off the suffix
...Form
from the form name and appending ...View
. The Wiki engine will
then use the template name MyView
to search for the correct template along
the template search path, for example using a topic MyView
.
Examples:
You have a form calledPurchaseRequestForm
. The plugin will now search for
PurchaseRequestViewTemplate
, and PurchaseRequestEditTemplate
.
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 change this behaviour in configure
so that the form defined templates
have priority.
Examples:
We have a form calledPurchaseRequestForm
which contains the usual table that defined the form fields.
We want this form to define that the topics are viewed with ViewFormAtTopTemplate
and edited with EditPurchaseRequestTemplate
.
Below this we place the two sections that defines the templates to be used. Note that you must omit the …Template from the template names.
%STARTSECTION{"viewtemplate"}%ViewFormAtTopTemplate%ENDSECTION{"viewtemplate"}% %STARTSECTION{"edittemplate"}%EditPurchaseRequest%ENDSECTION{"edittemplate"}%
Setting | Description | Default |
---|---|---|
{Plugins}{AutoViewTemplatePlugin}{Debug} | Turn on debugging by turning this on | Default: On |
{Plugins}{AutoViewTemplatePlugin}{Override} | Form defined templates override VIEW_TEMPLATE and EDIT_TEMPLATE settings | Default: Off |
{Plugins}{AutoViewTemplatePlugin}{Mode} | The mode the plugin uses for defining templates. exist for deriving the template name from the form name section for defining the template in a section of the form definition topic |
Default: exist |
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available inconfigure
, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Change History: | |
8 Apr 2016: | Released with Foswiki 2.1.1. Foswikitask:Item14014: Template files not working in hierarchical webs. |
7 Dec 2015: | Released with Foswiki 2.1. Foswikitask:Item13554: Enable non-ascii template names. |
18 Aug 2015: | Foswikitask:Item13625: AutoViewTemplatePlugin: reports Invalid template name ( Warning: Can't find named section viewtemplate in topic…) when used in "section" mode and no section exists. |
24 Jul 2015: | Released with Foswiki 2.0.1. Foswikitask:Item13554: Warn if invalid template name generated. |
16 Dec 2012: | Version released with Foswiki 1.1.7. Foswikitask:Item12297: Minor perllcritic change. |
10 Apr 2011: | Version released with Foswiki 1.1.3. Only a minor change related to how the plugin is being upgraded |
10 Dec 2010: | Foswikitask:Item10144: Fixed mistake in example in documentation |
31 Jul 2010: | Foswikitask:Item9415: Documentation updates |
06 Oct 2009: | Foswikitask:Item2213: Plugin got better documentation. No change in behaviour. |
20 Aug 2009: | Foswikitask:Item8248: added forward-compatibility for newer Foswikis (MD) |
27 Dec 2008: | Foswikitask:Item196: moved to Foswiki namespace |
15 Nov 2008: | Foswikitask:Item196: minor doc changes |
11 Jul 2008: | TWikibug:Item5770: try to derive the EDIT_TEMPLATE of a new topic using the WebTopicEditTemplate (MD) |
03 Jul 2008: | TWikibug:Item5747: fixed normalizing web part of form names (MD) |
13 Nov 2007: | added EDIT_TEMPLATE, speed improvements, docu (MD) |
29 Oct 2007: | TWikibug: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 |
Foswiki Dependency: | $Foswiki::Plugins::VERSION 1.026 |
CPAN Dependencies: | none |
Other Dependencies: | none |
Author | Foswiki:Main.OliverKrueger, Foswiki:Main.MichaelDaum |
Version | 1.24 |
Release | 2016-04-08 |
Repository | https://github.com/foswiki/distro |
Copyright | © 2008-2009, Oliver Krueger |
License | GPL (GNU General Public License) |
Home | Foswiki:Extensions/AutoViewTemplatePlugin |
Support | Foswiki:Extensions/AutoViewTemplatePlugin |