Item1749: Item1749: VIEW and EDIT TEMPLATES need qualified link to web
Priority: Normal
Current State: No Action Required
Released In:
Target Release: n/a
Applies To: Engine
Component:
Branches:
To set a template you need to provide an explicit web now which should not be needed.
Does not work:
* Set VIEW_TEMPLATE = TestTopic33
Works as expected:
* Set VIEW_TEMPLATE = Sandbox.TestTopic33
Example:
http://trunk.foswiki.org/Sandbox/TestTopic34
--
AndreUlrich - 17 Jun 2009
can someone please
confirm this bug under 1.0.5? if it is broken in 1.0.5, it really should be fixed before 1.0.6 is released.
this does work in 1.0.0--1.0.4. (1.0.0:
http://foswiki.org/Sandbox/TestTopic34 )
i have tested with a 1.0.4 installation, and it works without the
webname whether specified by
% META:PREFERENCE{name="VIEW_TEMPLATE" title="VIEW_TEMPLATE" type="Set" value="ThingView"}%
(like in
http://community.reefsimple.com/Reefapedia/Thing2 )
or
* Set VIEW_TEMPLATE = EquipmentView
(like in
http://community.reefsimple.com/Reefapedia/Equipment1#support , temporarily, for testing this)
--
WillNorris - 17 Jun 2009
There is no difference between 1.0.0 and our current 1.0.6 code. They both behave the same.
If you use the fully qualified name the example works. And if you use the naked topic name is does not work as you think it works. But it also works. There is no bug.
The reason is that VIEW_TEMPLATE and any other template follows a set of rules how to find a template.
When you say Set VIEW_TEMPLATE = TestTopic33 is will actually try to find a topic called SkinNameTestTopic33Template
and if this is not found it tries TestTopic33Template and then it gives up.
The rule is more complex as it actually searches in different places.
It is documented in
SkinTemplates.
If you look at
SkinTemplates you see the rules and you see this
- templates/web/script.skin.tmpl for each skin on the skin path
- this usage is supported for compatibility only and is deprecated. Store web-specific templates in topics instead.
- templates/script.skin.tmpl for each skin on the skin path
- templates/web/script.tmpl
- this usage is supported for compatibility only and is deprecated. Store web-specific templates in topics instead.
- templates/script.tmpl
- The topic aweb.atopic if the template name can be parsed into aweb.atopic
- The topic web.SkinSkinScriptTemplate for each skin on the skin path
- The topic web.ScriptTemplate
- The topic %SYSTEMWEB%.SkinSkinScriptTemplate for each skin on the skin path
- The topic %SYSTEMWEB%.ScriptTemplate
Legend:
- script refers to the script name, e.g
view
, edit
- Script refers to the same, but with the first character capitalized, e.g
View
- skin refers to a skin name, e.g
dragon
, pattern
. All skins are checked at each stage, in the order they appear in the skin path.
- Skin refers to the same, but with the first character capitalized, e.g
Dragon
- web refers to the current web
So with the fully qualified name the match is "The topic aweb.atopic if the template name can be parsed into aweb.atopic"
And with the simple naked topic name it reaches to the bottom without a match.
If you want it to match also naked topics I guess you can add it to your path in configure.
But I would follow the standard rule and simply define my Template topics with suffix "Template". Then you also know that it is a template topic.
No this is a No Action
--
KennethLavrsen - 19 Jun 2009
It may be processed correctly then. But if even long time Foswiki users like Will and I are irritated by this then there is something wrong.
just my 2 cents
--
AndreUlrich - 19 Jun 2009
I agree
you should consider ammending the default template search path with the naked topic name placed at the end.
There is a risk that it can break things so we need to think it through. So scope should be 1.1. The 1.0.6 release Sunday is too close.
Raise a feature request with yourself as developer.
--
KennethLavrsen - 19 Jun 2009