Tags:
create new tag
view all tags

SID-01389: Table not easy to read and maintain

Status: Answered Answered TWiki version: 4.1.0 Perl version: 5.10
Category: CategoryForms Server OS: n/a Last update: 13 years ago

Hi, first of all sorry if i missed to notice similar questions on the previous threads.

I have a table structured like this:

%TABLE{ sort="on" tableborder="0" cellpadding="4" headeralign="center" dataalign="center" cellspacing="3" cellborder="0" headerbg="gray" headercolor="black" databg="#FAF0D4, #F3DFA8" headerrows="2" footerrows="1" }%
| *Topic* | *OWNER* | *Backup owner* | *Last Update* | *Time since last update* | *Updated by* | *Overdue* | *Notes and Deliveries* | *Reminder* |
| MyTopicName |  |  | %REVINFO{topic="MyTopicName" "$date at $time" }% |%SEARCH{ "^MyTopicName$" scope="topic" regex="on" nonoise="on" format="$percntCALC{$FORMATTIMEDIFF(sec, 1, $TIMEDIFF($TIME($date GMT), $TIME(), sec))}$percnt ago"}%  | %REVINFO{topic="MyTopicName" "$username"}% | %SEARCH{"^MyTopicName$" scope="topic" regex="on" nonoise="on" format="$percntCALC{$IF($TIMEDIFF($TIME($date GMT), $TIME(), sec) > $EVAL(2*2629743),$percntRED$percnt topic out of date! $percntENDCOLOR$percnt |  |   <input type='submit' class='twikiSubmit' <input type='hidden' class='twikiInputField' name='to' value='@gmail.com' /> |, $percntGREEN$percnt topic up to date $percntENDCOLOR$percnt | | | )}$percnt"}%  

my problem is that i have to list lots of topics on this table and that make it very hard to edit, for example to add the owner or modify the email address, if I have to add each topic manually there. So i'm wandering if there is a way to make it more compact for example by setting a variable with the whole string and some parameters to set the pieces that are different for each topic.

Can anyone point me to an example that explain me how to include this varible in the table without losing the table formatting?

Thanks in advance

p

P.S. if can be of any interest or help the scen\ario is that i am trying to build a workaround to the absence of a plugin that keep track of topic's ownership and notify an out-of date topic. i know it's quick and very dirty but it kind of work, that's why i want now to make it nicer... smile Thanks again

-- PaoloGallo - 2012-01-30

Discussion and Answer

Try using includes. In the table cell write

%INCLUDE{"%TOPIC%" section="formula1"}

and in the bottom of the topic set the code in sections

%STARTSECTION{"formula1")%
%SEARCH{ "^MyTopicName$" scope="topic" regex="on" nonoise="on" format="$percntCALC{$FORMATTIMEDIFF(sec, 1, $TIMEDIFF($TIME($date GMT), $TIME(), sec))}$percnt ago"}% 
%ENDSECTION%

Those sections can be between hidden verbatim tags using

< vertatim class="twikiHidden">
< verbatim>

-- EnriqueCadalso - 2012-02-02

I tried the %INCLUDE% and it worked fine, thanks for the hint :). however i am not able to use the %STARTSECTION% bit. the topic that i include is empty and contain just that %SEARCH% and i would like to add other different bits, but if i add the startsection variable the search does not work anymore. i am bound to use a new empty topic for each part i want to include. Any idea why the sections are not working?

-- PaoloGallo - 2012-02-07

Look into TWikiForms based applications, this avoids the complexities you mention here and makes it so much easier to run reports. There is a TWiki application tutorial to learn the how to.

If you stick with your solution look into ParameterizedVariables.

-- PeterThoeny - 2012-02-08

The combination of %<nop>INCLUDE% from a topic that contain the whole table row (with placeholders) and the skipinclude variable as defined in SpreadSheetPlugin worked very well. each row is now just an include and is very easy to read and modify. Thanks for all the help smile

p

-- PaoloGallo - 2012-04-13

-- PaoloGallo - 2012-04-13

      Change status to:
ALERT! 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.
SupportForm
Status Answered
Title Table not easy to read and maintain
SupportCategory CategoryForms
TWiki version 4.1.0
Server OS n/a
Web server n/a
Perl version 5.10
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2012-04-13 - PaoloGallo
 
  • 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.