Question
How can I generate a topic dynamically based on data input into a form. I am trying to build a code library. Whenever a user enters in new code via a form I generated, I want to build a set of topic dynamically based on user input
WikiWords and template files I generated. For example I have a new code I want to submit. I want that data to be posted to the form, and additionally I want a 'details' page to be created based on the name of that code using a template I made.
Environment
--
OmarMussa - 27 Jul 2005
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.
Not sure I understand your question. You might need to build a
TWikiForms application with
TWikiTemplates.
See example applications:
MeetingMinutes,
SearchBookTitles,
ItemToDo,
ChangeRequest
--
PeterThoeny - 27 Jul 2005
I found a 4 step solution, this seems really powerful because I can now dynamically build pages that are linked to other pages. My solution was for reusable code so this shows how to build pages based on Algorithms. You could do whatever you want though.
1) Create a templatetopic. I used generic code like
HowToDynamicallyCreateTopics in the template so that I could use dynamic searches to build a table and to add headings, etc.
2) Create a Form. Specifiy the fields you want in the form (this will be used to store additional metadata used for searching).
3) Create a
FormTemplate. In the
FormTemplate, you will include code like the code below (just change
AlgorithmTopicTemplate to whatever you like). This will allow the user to click a 'Continue' button that will generate a page based on your templatetopic.
<form name="new" action="%SCRIPTURLPATH{save}%/%WEB%/" method="post">
<input type="hidden" name="topic" value="" size="23" />
<input type="hidden" name="templatetopic" value="AlgorithmTopicTemplate" />
<input type="hidden" name="onlywikiname" value="on" />
<input type="hidden" name="onlynewtopic" value="on" />
<input type="submit" value="Continue" />
(Press 'Continue' to complete the submission process)
</form>
4) Create a data entry page that calls the
FormTemplate. This page will contain input fields like 'AlgorithmName'. You can then use the input field to name the new topic when the user presses 'Continue'.
I don't know if this is exactly the correct terminology but its what I was able to do. I don't know if I am doing any redundant/un-necessary steps. My only issue remaining is this - I'd like to take out the 'edit/preview/save' cycle somehow. My challenge is, how can I store data to the form without this process? It may be a question that I have to re-ask.
--
OmarMussa - 10 Aug 2005
Omar - you're on the right track. I had meant to mention before to you
TopicClassificationAddOn which implements a very similar approach as you describe. It also provides a framework that simplifies the process of creating new topic categories. You might still find some useful things there - along the lines of pre-configured searches, menus, etc.
See further notes in
HowToSaveFormData.
--
LynnwoodBrown - 10 Aug 2005