Including controller output with iscomponent
Key Takeaway
Use <iscomponent pipeline="..."> to include a pipeline's output in a template, with any extra attributes passed to the pipeline as parameters. The included component can have a different caching policy than the page that contains it.
<iscomponent> is an ISML tag that includes the output of a pipeline, such as Product-Show, inside another template. You name the pipeline in the tag and pass parameters as attributes, so anyone reading the template can see where the content comes from. Use it to embed reusable functionality whose caching policy can differ from the page around it.
What iscomponent does
The <iscomponent> ISML tag includes the output of a pipeline in the page. Its purpose is to embed reusable functionality, encapsulated in a pipeline, into another template.
<iscomponent> sits alongside other ways to reuse content in a template, including these:
| What it does | |
|---|---|
Local include (<isinclude>) | Brings in content from another template file |
Remote include (<isinclude>) | Executes a second pipeline that returns the content |
<ismodule> | Declares custom ISML tags that insert a reusable template, with user-defined attributes |
<iscomponent> | Includes a pipeline's output, naming the pipeline and passing parameters as attributes |
Technically, <iscomponent> performs the same function as a remote include. The difference is in how you write it. <iscomponent> names the content-generating pipeline with pipeline-related attributes and accepts arbitrary attributes, so a reader can see which pipeline produces the content.
When the content must come from running a pipeline with parameters, <iscomponent> states that intent most clearly.