Tags:
create new tag
view all tags

Question

Hi- I'm trying to create topics BEFORE users are able to edit them.

As it stands now, users must:

(1) create a new topic, (2) edit the topic (3) preview the topic (4) save changes

I'm trying to hide the textarea in (2), so users aren't overwhelmed by all the templated text in there.

The problem I'm bumping into is that "textareas" can't be hidden (hidden is not an attribute). So trying to instead use < input type="hidden ... doesn't work because the cgi's require textarea.

It's also possible I'm going at the problem all wrong.

Any ideas?

Environment

TWiki version: TWikiBetaRelease
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  

-- SamAbrams - 19 Feb 2004

Answer

There has been a bit of discussion here TopicCreatePluginDev. It is true that the current CGI's do not have this functionality as I too have a need to go straight from topic create -> topic view since nearly all of the content in some of the things we are creating are built from templates and any user data is captured via EDITable tables. CrawfordCurrie provides an example that can work as long as templates are not needed.

-- SteveRJones - 19 Feb 2004

Thanks for your quick reply, Steve. I'm wondering if you've explored either of these two avenues:

(1) Modifying the registration script, which writes a user topic from the NewUserTemplate.

(2) I've noticed that textarea can be changed to < input type=hidden ... , as long as no quotes are used in the WeTopicEditTemplate. My template currently needs quotes, but I'm hoping to inch along in the right direction.

-- SamAbrams - 19 Feb 2004

As I recall some of the discussion, there was something about not creating "Yet Another Script". I was was thinking that perhaps EDIT.CGI could be modified to accept another parameter that would basically just push things through to the save script. Only problem, not all skins use the same save script so EDIT would have to know which one to invoke? Or maybe this isn't really an issue. Not sure as I haven't really explored the possibilities - I've been busy developing other aspects of our twiki site.

-- SteveRJones - 19 Feb 2004

Secondly, I added a HIDETEXTAREA tag into the TWikiForm template that is used in the view and edit rendering to remove the html textarea (I think i had to hard code it for the version of the TigerSkin that we use). It requires a small code change - is this what you are after?

-- SvenDowideit - 20 Feb 2004

Yes, this is actually exactly what I'm after, if you don't mind posting. Should we link this page to the TopicCreatePluginDev page, and post it here?

-- SamAbrams - 20 Feb 2004

With the latest TWikiAlphaRelease you get SaveContentWithoutEdit

-- PeterThoeny - 05 May 2004

sorry Sam - I lost track of this frown

the code looks like this

        $theParent = $2;
      }
    }
    $meta->put( "TOPICPARENT", ( "name" => $theParent ) );
  }
  $tmpl =~ s/%TOPICPARENT%/$theParent/;

#SVEN - don'e show standard editbox if there is a HIDETEXTAREA tag on the page
#    this is used for our Task system
    if ( $topic eq $formTemplate ) {
    } else {
        if (( $text =~ /HIDETEXTAREA/ )) {
            $tmpl =~ s/document.main.text(.*)//;
            $tmpl =~ s/<textarea name=(.*)>(.*)/<input type="hidden" name="text" value="%TEXT%" \/>$2/;
        }
    }
#end SVEN

  # Processing of formtemplate - comes directly from query parameter formtemplate , 
  # or indirectly from webtopictemplate parameter.
  my $oldargsr;
  if( $formTemplate ) {
    my @args = ( name => $formTemplate );

-- SvenDowideit - 05 May 2004

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2004-05-05 - SvenDowideit
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.