Question
I think I need something like INCLUDE but that literally sucks the content into the page inline, ala a template page but multiple templates.
Here's the problem:
We used to have one template with a single editable table on it --
a checklist with a set of questions. We used a form to copy the template into a new page and then people would fill in the
checklist table items.
Now things are more complicated. There are several
sections to the checklist tables. Some are required and others are not, depending on the project. So, in a sense, we have 4 "possible "templates" from which we need to create each
checklist page, by picking the appropriate pieces.
| Project Type |
Required Sections |
| Full Deployment |
SECTIONS B, C, D SECTION A if applicable |
| Upgrade |
SECTION C |
| Software Release |
SECTION D |
I would appreciate any advice from someone who might have done something like this before.
I can't just use INCLUDE because the sections have to be copied (so the
checklists tables can be edited).
Is there a way I'm not familiar with of copying content from several places?
Or, alternatively,
not copying some content, conditionally
Environment
--
VickiBrown - 16 Sep 2008
Answer
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 can't speak to the template questions, but I might add something about INCLUDE and checklists. I found that if you INCLUDE a topic that contains a checklist, the checklist is instantiated (is that the right word?) for each topic on which it is INCLUDEd. For an example of how we use this, see
New Employee Application on the Blog Web.
--
DavidWolfe - 17 Sep 2008
David - That's wonderful to know. Unfortunately, in these checklists, the users need to be able to do more than just check off an item. It's more of a table of "stuff to do" and they need the ability to add notes to any item row. So I think Checklist Plugin isn't going to work for us.
But knowing about this aspect of Checklist is something I'll keep in mind for the future!
--
VickiBrown - 17 Sep 2008
Hm, isn't the
ChecklistTablePlugin exactly that, an editable table for adding stuff to do and providing easy status switching ala
ChecklistPlugin?
--
FranzJosefGigler - 18 Sep 2008
Franz -
ChecklistTablePlugin is certainly an editable table for adding stuff to do and providing easy status switching, however it doesn't exhibit the interesting side effect of "instantiating" a copy of the modified content into the page where the code has been INCLUDED.
Like a simple EditTable, the reality of the table content remains on the page from which it's included. And that doesn't work with my use case. We don't want to change the content of the Template. We need
import (or conditional copy) rather than INCLUDE.
I shouldn't have referred to this as a "checklist". Although I appreciate learning about the cool side effect of INCLUDEd
ChecklistPlugin checklists, the overloaded terminology is causing confusion.
I don't need a way to build a checklist. I need to build pages using pieces of content imported from one or more other page(s)
--
VickiBrown - 18 Sep 2008
Good luck. Guess that would help building some impressive applications. -- Hm, rereading the question. Couldn't you use 4 different template topics and choose the right one at creation time? -- Forget my comment, I obviousely don't understand the problem deeply enough.
--
FranzJosefGigler - 19 Sep 2008
Franz - I could use multiple templates iff there was no overlap. The problem is that there IS overlap. So I'd have to duplicate content between the multiple templates. That leads to risk of information forking when anything is updated.
--
VickiBrown - 21 Oct 2008
I've got a workaround. Here's what I'm doing.
Here's part of the form that creates the page
<input type="radio" name="A" value="true" /> Choice A <br />
<input type="radio" name="B" value="true" /> Choice B <br />
<input type="radio" name="C" value="true" /> Choice C <br />
and here's what I do in the template:
%STARTSECTION{name="_SECTION0" type="templateonly"}%
* Set TEMPLATEONLY = 1
%ENDSECTION{name="_SECTION0" type="templateonly"}%
%IFDEFINEDTHEN{%<nop>URLPARAM{"A" default="%TEMPLATEONLY%"}%}%
Information to be copied for choice "A"
%FIDEFINED%
%IFDEFINEDTHEN{%<nop>URLPARAM{"B" default="%TEMPLATEONLY%"}%}%
Information to be copied for choice "B"
%FIDEFINED%
...
All of the content (except for the
templateonly section) is copied.
Because the
templateonly section is
not copied,
TEMPLATEONLY is not set.
Thus, the
IFDEFINEDTHEN sections trigger on the URLPARAM values that were sent through when the template was copied.
All content is
present but only the desired content is
shown.
It's not perfect, but it has its uses. And, if the user says "Oops, I chose the wrong item" it's easy to fix without deletng the page and starting over.
--
VickiBrown - 21 Oct 2008
Very pragmatic, but non the less usful.
--
FranzJosefGigler - 22 Oct 2008