Tags:
create new tag
view all tags

Question

I am re-developing a template. I have a working template in the templates directory:

templates/view.demo.tmpl

reading TWikiTemplates 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

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Linux 2.4 debian
Web server: apache 2
Perl version: 5.8
Client OS: linux 2.4 debian
Web Browser: mozilla firefox
Categories: Skin

-- BramVanOosterhout - 10 Nov 2007

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is 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

Change status to:
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2007-12-04 - BramVanOosterhout
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.