Classification-Driven Page Layout
Proposal: Topics view template should be drivable according to an attribute of the topic, such as a form value. This would allow different types of pages to appear differently and according to a set of
PageLayouts.
So far I've determined that PatternSkin's TWIKILAYOUTURL can give me some control, but it seems not enough...
Background
Thinking about how home pages should be presented and how some pages should look different to others, it occurred to me that
ClassificationDrivenControls was only part of the story. Not only do I want whether a comment box appears by default but the whole layout of the page should too change with a Page Type change.
Hence home pages might have the photo first top LHS, form data at the top in the middle, with the standard links (e.g.
TWiki.ChangePassword down the right hand side and the body of the document below, with only what the user wrote about themselves. Standard links would no-longer appear
in people's pages, they come from the layout.
Bug Reports again could look different, with the
PageLayout incorporating the
TWikiControl for a
PainMeter.
Feature Requests again visually different, with the
PageLayout dictating a
DesireMeter.
Feature Brainstorming could feature an Agreementscale by default.
etc
Questions
TWiki's view.pattern.tmpl seems to be driven by:
%TMPL:P{"htmldoctype"}%
%TMPL:P{"head"}%
%TMPL:P{"bodystart"}%
%TMPL:P{"main"}%
%TMPL:P{"bodyend"}%
With this definition dictating the positioning of the elements on the page:
%TMPL:DEF{"main"}%%TMPL:P{"topbar"}%<div class="twikiMiddleContainer">%TMPL:P{"leftbar"}%<div class="twikiMain">%BROADCASTMESSAGE%%TMPL:P{"toolbar"}%
%TMPL:P{"content"}%
%TMPL:P{"standardfooter"}%</div></div>%TMPL:P{"bottombar"}%%TMPL:END%
and, in turn, this one driving the order of elements in the content piece:
%TMPL:DEF{"content"}%<div class="twikiHidden"><hr /></div><a name="Content"> </a><div class="twikiHidden">Start of topic | <a href="#Actions">Skip to actions</a><hr /></div>
<div class="twikiTopic">
%TEXT%
<br class="twikiClear" />
#TopicEnd
<span class="twikiRight twikiPageNav twikiGrayText"><a href="#PageTop">to top</a></span><br class="twikiClear" />
</div><div class="twikiHidden"><hr />End of topic<br /><a href="#Actions">Skip to action links</a> | <a href="#PageTop">Back to top</a><hr /></div>
%TMPL:P{"form"}%%TMPL:P{"attachments"}%%TMPL:P{"topicaction"}%
%TMPL:P{"topicinfo"}%%TMPL:END%
If I read it right,
PatternSkin now lets me customise the classes used by this definition, but does not let me, for instance, put the form before the content... which is exactly what I want to do for user pages: use the meta data to contain the standard information and then augment this with the person's description of themself.
Perhaps someone can help me out with this? Thanks.
--
MartinCleaver - 02 Oct 2004
You shouldn't be able to see anything below here...
Disagreements
Other
As easy as it seems?
Agreements / Disagreements
Disagreements
Other
-->
--
MartinCleaver - 02 Oct 2004
Something is not right with the html escaping.
To answer the question: you can either create a skin based on pattern skin, or try to use css positioning. See
Zen garden
for possibilities.
--
ArthurClemens - 02 Oct 2004
I was hoping to do this without creating a new skin; I am really quite a novice when it comes to
CSS. Arthur, can you confirm that you feel I'd have to create a view.x.tmpl file and that its not possible to do with the TWIKILAYOUTURL? Thanks.
--
MartinCleaver - 02 Oct 2004
To get the form to appear above the text you should be able to do it with
CSS if TWIKILAYOUTURL could vary depending on form values.
--
SamHasler - 02 Oct 2004
I would need to do some css experiments to see what is possible. But I am very time constrained this week, so I can't offer the results quickly.
--
ArthurClemens - 02 Oct 2004
Thanks Arthur. I should note that where the topics are in a different web I can do this easily enough - I simply make templates/Main and copy templates/view.pattern.tmpl to templates/Main/view.pattern.tmpl, and move
%TMPL:P{"form"}%
just before the
<div class="twikiTopic">
It does not solve the classification driven piece but might be useful to someone.
--
MartinCleaver - 03 Oct 2004
I believe this is solved by
SupportTopicSpecificTemplates, which is available on
DevelopBranch. It would still be nice to see how this could be done by
CSS.
--
ThomasWeigert - 25 May 2005