Textpattern PHP Cross Reference Content Management Systems

Source: /textpattern/setup/forms/misc.images.txp - 28 lines - 1060 bytes - Text - Print

   1  <!-- set up a variable to check whether an image also has a caption associated with it... -->
   2  <txp:variable name="caption" value='<txp:image_info />' />
   3  
   4  <!-- ...now use that image caption and wrap img inside a figure with figcaption tags, otherwise just use a plain img tag -->
   5  <txp:if_variable name="caption" value="">
   6  
   7      <!-- image - overriding the width and height to let the image scale to fit parent container -->
   8      <p itemprop="image">
   9          <txp:image width="0" height="0" />
  10      </p>
  11  
  12  <txp:else />
  13  
  14      <figure itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
  15  
  16          <!-- image - overriding the width and height to let the image scale to fit parent container -->
  17          <span itemprop="contentUrl">
  18              <txp:image width="0" height="0" />
  19          </span>
  20  
  21          <!-- you do not need to specify the attribute type="caption" as that is the default setting for <txp:image_info /> tag -->
  22          <figcaption itemprop="caption">
  23              <txp:image_info />
  24          </figcaption>
  25  
  26      </figure>
  27  
  28  </txp:if_variable>

title

Description

title

Description

title

Description

title

title

Body