create new tag
, view all tags
I managed to get my categories displayed as a bulleted list by modifying twikicatview.tmpl to look like this:

<!--<nop>TWikiCat--> <h4> WikiLearn Page Evaluation </h4>
   * %<nop>CATNAME%:  %<nop>CATMODIFIER%  %<nop>CATVALUE%

Note: Ignore all the <nop>s (and delete if you copy) -- I added those because the text disappeared the first time I saved it here -- I'm not sure whether it caused any problems for TWiki -- there was a period after I saved this when I could not reach twiki.org -- coincidence?

It was pretty much a trial and error process, but I can't find a way to set the spacing between categories to single space (no blank lines). It seems there is an extra <p> between each bulleted item. I suspect I'll have to make a change in the CGI programs to achieve single spacing.

I'm a Perl newbie (or less) but I tried looking through several of the files (view, TWiki.pm, edit, Store.pm (just on a whim)), but I can't find much about processing the categories (for display). I'm beginning to suspect that that the extra <p> is sort of intrinsic -- maybe I have to chomp (or chop) a string somewhere to get rid of it?

Any hints?

Uuh, wait, I got a hint -- the categories are stored double spaced in the .txt file -- and I think I saw somewhere the code that was storing the categories -- I'll take another look. (BTW, by changing the spacing in the .txt file, I got the single spacing I was looking for -- I just don't want to have to edit every .txt file.)

-- RandyKramer - 23 Jun 2001

Well, some partial success and some failure.

Partial success:

I edited the preview script as follows, and that got single spacing within the list -- I now plan to work on decreasing the spacing between the TEXTAREA and the heading for the categories, and then from the heading to the first bullet. (BTW: This is my first (apparently) successful modification of a Perl program! Oops, forgot, this is my second modification, the first problem was much simpler to find.)

In this block of code (from the preview script, 20010315 beta), on line 164 of the original file, I added a chomp function (and now added a second, a little further down):

    if( $icat ) {
        # get category items from parameters and build category section
        $tcat = &TWiki::Store::readTemplate( "twikicatview" );
        my $line = "", $ttext = "", $temp = "";
        ( $before, $line, $after) = split( /%REPEAT%/, $tcat );
        foreach( split( /\n/, $icat ) ) {
            my( $catname, $catvalue ) = buildCategoryItem( $_ );
            if( $catname ) {
                if( $catname eq "DELETE_ME" ) {
                    $ttext = "";
                $temp = $line;
                $temp =~ s/%CATNAME%/$catname/go;
                $temp =~ s/%CATMODIFIER%//go;
                $temp =~ s/%CATVALUE%/$catvalue/go;
# rhk: 20010623: chomp added to set single spacing within bulleted
#   twiki categories (along with change to twikicatview.tmpl to
#   strip out table related stuff -- left the %REPEAT%s)
                $temp =~ chomp($temp);
                $ttext = "$ttext$temp";
        if( $ttext ) {
# rhk: 20010623: another chomp
            $tcat = "$before$ttext$after";
        } else {
            $tcat = "";

Failure: It looks like pasting my modified twikicatview.tmpl on this page (even within verbatim tags) may not have been a good idea. Those lines are no longer visible in the edit window, even though they appear to still be visible in the view after a refresh. It will be interesting to see what happens when I save this edit. I hope it hasn't caused major problems to TWiki.

PS: I left this under feature brainstorming because I can't call it feature implemented -- I don't think the change is of the quality we want in a real change to TWiki (in that it is not selectable, and has not been thoroughly tested). For the time being I intend to implement this only on my home TWiki, and later on WikiLearn.

-- RandyKramer - 23 Jun 2001

Well, it looks like the twikicatview.tmpl is gone. I'm going to paste it in again, but insert <nop>s or whatever to keep it from being recognized and processed by TWiki.

Just for historical interest, after I saved the first edits in konqueror, the twikicatview.tmpl was gone. But, when I went to IE5 on my Windows box and refreshed (the view window), it was still there -- must be a difference in the cache behavior. (Or could the text have still been there, but konqueror could not see it in either the view or edit window, while IE5 could? IIRC, I did not check to see if it was visible in a refreshed edit window under IE5 before I readded it with <nos>s (in konqueror). And I don't want to repeat the experiment on twiki.org.)

-- RandyKramer - 23 Jun 2001

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2001-06-24 - RandyKramer
  • 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.