[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
Re: [ic] [include] in [list]
bill@worldwideimpact.com wrote:
>
> I need to use the same basic html on two different pages. My goal is to
> not have to maintain two copies of it.
>
>
> ...blah blah blah removed.
If you have the same HTML that is to be embedded in a query, but the
query is what changes, there are many ways you can do this. Your problem
is you will never get the interpolation order right because ALL the
[sql-param] tags will parse before ANY of the [include] tags do.
Personally, I would simply use the same file which will have different
data depending on some parameters that build a different query.
However, if you have a 1-1 correspondence between a product and the
framing html, but it is ONLY the HTML from inside the [query][/query]
tag that stays the same, you can do this.
(1) Set your SQL into a scratch var in the page
(2) Where you currently have a [query]...[include]...[/query], replace
that with only the [include].
(3) Inside the included file, place your [query] stuff [/query] code,
and use the scratch variable as the SQL to execute.
If you have multiple variations that depend on what product it is, you
can simply use [scratch]'s to perform the logic, which all must be set
in the parent document prior to the [include] tag.
--
Mark Johnson
Senior Systems Architect - Professional Services
Red Hat, Inc.
E-Business Solutions
markj@redhat.com
703-456-2912