6D Labs / CQ Extended Tag Library / API / Tags / defer

Defer Tag

Defers the writing of HTML until a WriteDeferred tag is evaluated. This is useful especially for JavaScript libraries which may be in components on the page, but should be evaluated at the end of the page for performance reasons.

  • name - defer
  • class - com.sixdimensions.wcm.cq.taglib.ext.DeferTag
  • attributes:
    • id - The id of the content block, ensures content is only written once

Example:

<ext:defer id="a-script-block">
  <script>
    alert("Hello World");
  </script>
</ext:defer>

Follow Our Blog Posts

Latest CQ News