Question
I am re-developing a template. I have a working template in the
templates directory:
templates/view.demo.tmpl
reading
TWikiTemplates#Finding_Templates I understand that I can put the content of this template in topic DemoSkinViewTemplate in the same web and remove the
templates/view.demo.tmpl file.
However, the result is not the same. Instead I revert to the view as if no skin is defined.
What am I missing?
Here is the content of the template:
%TMPL:INCLUDE{"demo"}% %TMPL:P{"htmldoctype"}% %TMPL:P{"htmlhead"}%
%TMPL:P{"topicaction"}%
TWIKI
%INCLUDE{WebDemoEditMenu}%
%TMPL:P{"qms_page"}%
%TMPL:P{"topicaction"}%
%META{"attachments"}%
%TMPL:DEF{"topicaction"}% %EDITTOPIC% | Attach | More | Publish %TMPL:END%
Environment
--
BramVanOosterhout - 10 Nov 2007
Answer
If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.
I remain interested in an answer. I have been unable to get the documented mechanism to work. I must be missing something. Any suggestions?
--
BramVanOosterhout - 27 Nov 2007
I am STILL interested in an answer. I have managed to get covers to work. Both in view and when publishing. I have also worked out how the skinpath works. And the template for view.cover.tmpl will produce a standard view when using the browser, but when publishing it will use the publish view.
In essence, view.cover.tmpl includes render %TMPL:INCLUDE{"render"}%
I have two templates: render.standard.tmpl and render.publish.tmpl. In the view script I use the cover,standard skinpath, in the publish script the skinpath is cover,publish,standard. works a treat.
But now I am faced with a multitude of view.cover.tmpl files, one for each cover category. This is annoying, because they are essentially user driven and i don't want to give users access to the template directory.
But i cannot get the SkinTopic to work!
Any suggestions?
--
BramVanOosterhout - 03 Dec 2007
I am quite confused. You have covers working, you mention
view.cover.tmpl and
render.standard.tmpl. So I tend to think you got the template naming mixed up.
I am not saying it won't work, but what we're used to is:
- If you want to change the view of a page, use
view.skinname.tmpl, where skinname is your skin: "publish", "standard" etc.
- Use
cover if you need a fallback to the default (custom) skin. For instance SKIN = standard and COVER = publish will show the standard view if no publish template is found
- To set the view template of a topic, you can set
VIEW_TEMPLATE = SkinNameView, while the template is defined in SkinNameViewTemplate.
--
ArthurClemens - 03 Dec 2007
Thanks Arthur. I understand your confusion. The problem is that I cannot take the definition in view.demo.tmpl and paste that in
DemoSkinViewTemplate, remove the view.demo tmpl and still get the same result. That is the bug report 10 November 2007.
On 3 december I thought it might be useful to to explain why i wanted to solve this problem. Sorry to confuse you.
I could not sleep last night, went to hospital today and have worked it out. See my notes at the bottom of
TWikiTemplates.
Suggestion for improvement: mention the TemplatePath on the
TWikiTemplates page. Reading through the code helped a lot.
Thanks for your response.
And for the reference to the VIEW_TEMPLATE variable. I was not aware of it. I am using COVER in the way you suggest to use VIEW_TEMPLATE. Is View_TEMPLATE a documente feature. I don't find it in
TWikiVariables.
I have closed this call.
--
BramVanOosterhout - 04 Dec 2007