SID-01334: Generating a topic index with the SpreadSheetPlugin
| Status: |
Answered |
TWiki version: |
5.0.2 |
Perl version: |
|
| Category: |
SpreadSheetPlugin |
Server OS: |
SLES 11 |
Last update: |
14 years ago |
I was trying to generate some kind of dynamic list based on your example
DashboardWithDynamicInclude in the
SandBox Samples
The list is generated from the formfield 'Document Type' in the topics.
This is my code but I am unable to get any index results, through there are 9 hits from the search:
<verbatim>
%SEARCH{ "Question" scope="text" web="TSD" reverse="on" limit="30" nonoise="on" format="<nop>$percntCALC{$SET($formfield(Document Type), $GET($formfield(Document Type)))}$percnt"}%
<!-- define list -->
%CALC{"$LISTJOIN($comma,$LISTNONEMPTY($GET(Document Type)))"}%
<!-- number of columns in table -->
%CALC{$SET(cols, 4)}% <!-- init cell number --> %CALC{$SET(n, 0)}%
<noautolink> <font size="-1"> </font> </noautolink>
<table border="1" cellspacing="0" cellpadding="5" width="100%"><br><tr> <th colspan="%CALC{$GET(cols)}%" bgcolor="#CCCCCC"><br>Dashboard Example</th></tr>
<tr> %CALC{$TRANSLATE($LISTMAP(<td valign=\"top\"><b>$item</b>%BB% link: $item%BB% lower: $LOWER($item)%BB% upper: $UPPER($item)%BB% spaced: $PROPERSPACE($item) </td> $SETM(n, +1)$IF($MOD($GET(n),$GET(cols)),,</tr><tr>), $GET(list)),$comma,$sp)}% </tr></table>
</verbatim>
--
RonMascarenhas - 2011-11-18
Discussion and Answer
$SET requires a variable name as the first parameter. In CALC{$SET($formfield(Document Type), $GET($formfield(Document Type)))}$percnt you try to set the value of the field Document type to a variable, so you should use something like CALC{$SET(doc_type, $GET($formfield(Document Type)))} and then later retrieve that value using $GET(doc_type).
--
EnriqueCadalso - 2011-11-20
Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the
TWiki consultants if you need timely help. We invite you to
get involved with the community, it is more likely you get community support if you support the open source project!
--
PeterThoeny - 2012-01-23
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.