Item14930: Skin templates do not accept a slash (/) as web- subweb separator
Priority: Normal
Current State: Being Worked On
Released In: n/a
Target Release: n/a
Applies To: Web Site
Component: SkinTemplates
Branches: Release02x01
There is a problem using skin templates in topics in nested webs.
TMPL:INCLUDE{"Applications/WebApp.TopicView"}
gets mangled by the regex{filenameInvalidCharRegex} in Template.pm line 387:
387 $name =~ s/$Foswiki::regex{filenameInvalidCharRegex}//g;
Before line 387 name = Applications/WebApp.TopicView
After line 387 name = ApplicationsWebApp.TopicView
The slash (/) is stripped. The work around is to use a dot (.) instead of a slash to separate the webs.
The documentation suggests the slash (/) is valid.
Discussion in
Support Question2065
I will update the documentation with the following patch:
diff --git a/core/data/System/SkinTemplates.txt b/core/data/System/SkinTemplates.txt
index 3e5335557..6b481e904 100644
--- a/core/data/System/SkinTemplates.txt
+++ b/core/data/System/SkinTemplates.txt
@@ -1,4 +1,4 @@
-%META:TOPICINFO{author="ProjectContributor" comment="" date="1506603718" format="1.1" version="1"}%
+%META:TOPICINFO{author="BaseUserMapping_333" comment="" date="1597293348" format="1.1" reprev="3" version="3"}%
%META:TOPICPARENT{name="Skins"}%
%STARTINCLUDE%
---+ Skin Templates
@@ -238,6 +238,8 @@ For example, let's say we are viewing a topic in web =%SANDBOXWEB%= and are sear
When a skin name or template name is used to build a topic name, the first character is automatically capitalised.
+When a !SubWeb is used, the $web reference must be qualified with a dot (.), not slash (/). For instance: If SANDBOXWEB above is a !SubWeb, then the reference must be <code>SANDBOXWEB= Sandbox.SubWeb</code>. =Sandbox/SubWeb= does not work.
+
The _skin path_ is set as described in [[Skins]].
#TemplatePreferences
@@ -253,9 +255,9 @@ then the indicated templates will be chosen for =view= and =edit= respectively.
Note that the topic name specified as a template may need to be fully qualified with Web and !SubWeb. E.g.
<verbatim>
- * Set VIEW_TEMPLATE = Web/SubWeb.SpecificViewTemplate
+ * Set VIEW_TEMPLATE = Web.SubWeb.SpecificViewTemplate
</verbatim>
-Also the qualification needs to be given in the form !Web/SubWeb.TopicTemplate as in the example; !Web/SubWeb/TopicTemplate does not work.
+Also the qualification needs to be given in the form !Web.SubWeb.TopicTemplate as in the example; !Web/SubWeb.TopicTemplate or !Web/SubWeb/TopicTemplate does not work.
#TemplateSecurity
---+++ Security and usability
-- Main.BramVanOosterhout - 29 Aug 2020
I think you are doing something rather simple in a very convoluted way: just check in your patch to the master branch.
Then, to bring the same change set over to the distro branch, check out the distro branch and cherry-pick the commit.
Done.
No need to cerate an extra branch and pull requests. Actually, as things are right now, one can hardly cherry-pick the single change you did, given all the merging going on on this extra branch.
Please, do keep things simple and just check in the simple patch. Do not merge the branche over to either master or distro as bad things might happen on either one. Haven't looked at your item branch on which of the branches (master or distro) it is based on.
-- Main.MichaelDaum - 31 Aug 2020
Hmm, sorry to be a pain.
I will go and read the manual in detail as I do not understand the instructions above.
Check in the patch? What does that mean?
Feel free to ignore this update and delete the branch from the repository.
I'll start with
https://www.devroom.io/2009/10/26/how-to-create-and-apply-a-patch-with-git/
-- Main.BramVanOosterhout - 31 Aug 2020