Question
I would like to force the form to be at the beginning of the Topic instead of the end. I found this question on the TWiki support site, but it was asked 5 years ago and the answer isn't intuitive enough for me (being a beginner).
Here is the link to that question...
FormAtTheBeginningOfTopic
So Peter says to use the
%META{"form"}% variable in the view / edit templates and skins."
Can anyone expand upon this for me? I'm not sure what do with this...
Thanks in advance
REB
Environment
--
RyanBauerle - 14 Sep 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.
If you are using TWiki's default skin (pattern skin), have a look at
TWiki05x01.PatternSkinCustomization, especially at the section
I want to place the form at the top. The topic, when read from its beginning, describes how to proceed, but if you're in for a quick hack, simply use an editor to change
templates/view.pattern.tmpl and
templates/edit.pattern.tmpl as described in that section. This needs to be repeated every time you upgrade, so in the long run reading the topic from the beginning might pay off
--
HaraldJoerg - 14 Sep 2007
So from that article, it says that I can simply type the following in the topic template, but when I do so it just shows up as text and the form stays at the bottom...what am I missing?
%TMPL:INCLUDE{"view"}%
%TMPL:DEF{"formattop"}%%TMPL:P{"form"}%%TMPL:END%
--
RyanBauerle - 14 Sep 2007
Ok, so figured out that I can simply put
%META{"form"}% wherever I want the form to appear, but then it appears at the bottom also. Is it possible to only have the form appear where I put the
%META{"form"}% ?
--
RyanBauerle - 14 Sep 2007
If you are using pattern skin, you must also void the default location (formatbottom):
%TMPL:INCLUDE{"view"}%
%TMPL:DEF{"form"}%%META{"form"}%%TMPL:END%
%TMPL:DEF{"formattop"}%%TMPL:P{"form"}%%TMPL:END%
%TMPL:DEF{"formatbottom"}%%TMPL:END%
--
ArthurClemens - 14 Sep 2007
Ok, so I was able to use the pattern skin, but that presented a couple more problems.
1. The form now goes too far to the top...I want it to be just below a bolded heading (ie. --++Server Information)
2. How do I get all links to use the new skin. I know I can append ?cover=skinname to the URL, but this can't be the solution...
Thanks
Ryan
--
RyanBauerle - 18 Sep 2007
A topic text is just one block,
TEXT in a template. To have a heading above the form requires you to write a custom template:
- use a webform with a page title field, or use a variable, for instance
Set PAGE_TITLE = Server Information. And extract the value from formfield or variable in the template
- have the
%META{"form"}% below that to render the form
- have
%TEXT% below that
Examples, and how to set the skin variable is all in
PatternSkinCustomization.
--
ArthurClemens - 18 Sep 2007
Thanks for all your help!
--
RyanBauerle - 18 Sep 2007
I would like a little clarification on this answer, if you don't mind. I have a page called
TicketTemplate, which contains a
TicketForm that I would like to be displayed at the top (and not the bottom). I ONLY want the form on the top for topics that use this template.
If I type the following code into the edit box for
TicketTemplate:
%TMPL:INCLUDE{"view"}%
%TMPL:DEF{"form"}%%META{"form"}%%TMPL:END%
%TMPL:DEF{"formattop"}%%TMPL:P{"form"}%%TMPL:END%
%TMPL:DEF{"formatbottom"}%%TMPL:END%
...then the TMPL:DEF and TMPL:END tags just appear as text. What am I doing wrong?
Thanks.
--
KevinCraft - 14 Dec 2007
See
TWiki.HowToMoveTheFormToTheTopOfThePage
--
VickiBrown - 05 Mar 2008