Tags:
create new tag
, view all tags

Question

I want to combine the function which creates a new topic with !

%COMMENT{type="bulletabove"}% such that the new topic is added to the bottom of a bullet list on the parent page (directly above) at the same time as being created. Can anyone help me with this?

For example, I would like something looking like this on my page:

  • PreviouslyAddedTopics
  • OtherTopics
PLEASE DON'T ACTUALLY USE THIS BUTTON

When you enter a new topic into the text box (eg NewTopicExample) and hit the button, the new topic would be created as a child of the current topic (I can do this bit) and the new topic name would be added to the current topic as a bullet list above the text box, eg:

  • PreviouslyAddedTopics
  • OtherTopics
  • NewTopicExample
PLEASE DON'T ACTUALLY USE THIS BUTTON

I make the text box and create topic button like this:

<form action="%SCRIPTURLPATH%/edit%SCRIPTSUFFIX%/%WEB%/">
<input type="text" name="topic" size="32" /> 
<input type="hidden" name="topicparent" value="%TOPIC%" />
<input type="submit" value="Create Topic" /> 
</form>

....but I don't know how to create the bullet list too. Hope that clarifies the request.

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Linux 2.6.9-34.elsmp
Web server: Apache/2.2.2 (Fedora)
Perl version: 5.008008 (linux)
Client OS:  
Web Browser:  
Categories: Deployment

-- TamsinTweddell - 30 Jul 2007

Answer

ALERT! 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.

I don't know what you mean, be more clear.

-- GrazianoMisuraca - 31 Jul 2007

Check out the CommentPlugin. It has all the functionality you need for adding an item to a bullet list.

If you want to create and save a topic by hitting the button you need to look at TWikiScripts#save.

The BlogAddOn does soemthing quiet similar to your request. If you comment a blog post a customized comment template creates a comment topic and adds the comment to this topic in one run. No edit/save cycle needed.

It would be easier though, if you just add the topic name to the list and then create the topic by clicking on the ?

-- CarloSchulz - 02 Aug 2007

It appears that you are asking if TWiki can do two things with one form: create a new topic and post a comment (to add topic to bullet list). As far as I know, that is not possible. However, almost the same thing could appear to happen if you generated the bullet list using a search and used the form to add a new topic that that had some unique identifier which the search would find. By including a =redirectto parameter in the form, you would immediately return to the original topic and your new topic would show up in the list.

-- LynnwoodBrown - 02 Aug 2007

How about instead you add a create topic link, but in the topic that it's in, add an automatically generated key. from TreePlugin, That's exactly how we do it here.

---+!! %MAKETEXT{"Welcome to the [_1] web" args="<nop>%WEB%"}%
This is the web where any topics QA related are placed.

%TREE{excludetopic="Web*" formatting="outline" format="* [[$topic][$spacetopic]]" levelprefix="   " startlevel="1"}%

[[WebTopicCreator][Create a new Topic]]

-- GrazianoMisuraca - 03 Aug 2007

I haven't tried it, yet, but I believe the answer to what you want is here: http://www.webmasterworld.com/forum23/1052.htm "submitting two forms with one button". Also, http://www.crossedconnections.org/w/?p=7&more=1&c=1 "Multiple form submit with one button: Ajax to the rescue"

This is something I've wanted to do, too. I'll make an effort to try this out. If I get it to work, I'll post back here.

-- TroyGoodson - 31 Mar 2008

Here's a first cut CreateTopicAndAttachInOneStep

-- TroyGoodson - 08 Apr 2008

Troy, very cool! !

-- PeterThoeny - 08 Apr 2008

 
Change status to:

Topic revision: r10 - 2008-05-06 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.