Tags:
create new tag
view all tags

Question

From a form button, I create a topic based on a page template that contains a heading and a DBI_Query. The query contains a WHERE that should use the %TOPIC% of the created topic. However, in the created topic, the query has been run using the %TOPIC% of the template. How do I postpone the evaluation of the included %TOPIC%, such that it evaluates to the value of the created topic? The template contains:

%INCLUDE{"ProyectoTABase" section="part1"}%%TOPIC%%INCLUDE{"ProyectoTABase" section="part2"}%

The 'ProyectoTABase' topic contains:

%STARTSECTION{"part1"}
...
---++++Proyecto: %ENDSECTION{"part1"}%
%STARTSECTION{"part2"}% 
%DBI_QUERY{"bugzilla"}%
SELECT alias, bug_id, short_desc, cf_cod_req_orange, deadline, cf_fecha_int, cf_fecha_prev_prod, cf_fecha_prod, estimated_time, cf_cod_pap, cf_cod_entrega, cf_num_deliv, cf_estado, cf_archivar
FROM bugs 
WHERE cf_tipo = 'Enhancement'
AND alias = '%TOPIC%'
.header
| *Cod RU*  | *Proyecto*  |  *Req*  | *Bug Id* |  *F Prev Int*  |  *F Int*  |  *F Prev Prd*  |  *F Prd*  |  *Esf(Hor) * | *PAP* | *Del Note*  |*NēDel*|  *Estado*  |*Arch*|\n
.body
|%alias%|%short_desc%  |%cf_cod_req_orange%|  [[http://%BUGZILLA_HOST%/bugzilla/show_bug.cgi?id=%bug_id%][%bug_id%]]  |%deadline% |%cf_fecha_int% |%cf_fecha_prev_prod% |%cf_fecha_prod% |  %estimated_time% |%cf_cod_pap%| %cf_cod_entrega% |%cf_num_deliv%  |%cf_estado% |%cf_archivar%|\n
.footer
%DBI_QUERY%%ENDSECTION{"part2"}%

Thanks in advance for any help. Ralph

Environment

TWiki version: unspecified
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: HP-UX
Web server: Apache 3
Perl version: 5
Client OS: WinXP
Web Browser: IExplorer
Categories: Forms

-- RalphEllison - 11 Dec 2007

Answer

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.

You can use %INCLUDINGTOPIC% to reference the topic that is including the current topic. And you can insert at %NOP% into the middle of a variable to stop it from expanding when the template is initially expanded. The %NOP% will be removed from the edit text. So %TOP%NOP%IC% will become %TOPIC% when saved.

-- GeorgeClark - 09 Jan 2008

Closing question, seems to be answered.

-- PeterThoeny - 09 Jan 2008

Change status to:
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2008-01-09 - PeterThoeny
 
  • 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.