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
--
RalphEllison - 11 Dec 2007
Answer
If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list 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