Each element will contain a block of HTML in a file called template.txt. The format of this file is identical to a regular template, i.e. pure renderable HTML content without doctypes or non-body sections:

<h1 data-bind="text: title"></h1>

When designing templates that make use of elements, you need to add some additional tags that enable the elements to be rendered as part of the output page. Consider this example that makes use of an element to display a product title for a list of products:

Widget template using elements
  <!-- oc layout: panels -->
  <div class="oc-panel panel-1" data-oc-id="panel-1">
    
    <!-- oc section: product-image -->
      <div data-bind="element: 'product-image'"></div>
    <!-- /oc -->
    
    <!-- oc section: product-image-carousel -->
      <div data-bind="element: 'product-image-carousel'"></div>
    <!-- /oc -->
    
  </div>
  <!-- /oc -->

The notable changes to the template are:


Copyright © 1997, 2016 Oracle and/or its affiliates. All rights reserved. Legal Notices