Item1749: Item1749: VIEW and EDIT TEMPLATES need qualified link to web

pencil
Priority: Normal
Current State: No Action Required
Released In:
Target Release: n/a
Applies To: Engine
Component:
Branches:
Reported By: AndreUlrich
Waiting For:
Last Change By: KennethLavrsen
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

  1. templates/web/script.skin.tmpl for each skin on the skin path
    • ALERT! this usage is supported for compatibility only and is deprecated. Store web-specific templates in topics instead.
  2. templates/script.skin.tmpl for each skin on the skin path
  3. templates/web/script.tmpl
    • ALERT! this usage is supported for compatibility only and is deprecated. Store web-specific templates in topics instead.
  4. templates/script.tmpl
  5. The topic aweb.atopic if the template name can be parsed into aweb.atopic
  6. The topic web.SkinSkinScriptTemplate for each skin on the skin path
  7. The topic web.ScriptTemplate
  8. The topic %SYSTEMWEB%.SkinSkinScriptTemplate for each skin on the skin path
  9. 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

ItemTemplate edit

Summary Item1749: VIEW and EDIT TEMPLATES need qualified link to web
ReportedBy AndreUlrich
Codebase 1.0.5, trunk
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r8 - 19 Jun 2009, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy