Primary Tag
Returns the full contents of your Wygwam field.
{exp:channel:entries channel="blog"}
<h1>{title}</h1>
{wygwam_field}
{/exp:channel:entries}
Wygwam comes with a few template tags to help your customize your template output.
To use them, place them within an {exp:channel:entries} tag pair that’s pulling in an entry with a Wygwam field.
Note: Replace “wygwam_field” in the following examples with the actual name of your Wygwam field.
Returns the full contents of your Wygwam field.
{exp:channel:entries channel="blog"}
<h1>{title}</h1>
{wygwam_field}
{/exp:channel:entries}
The following tags deal with Wygwam fields which use the new “Read More” separators.
:excerpt tagIf your field has a “Read More” separator, this returns your Wygwam field contents up until that point. Otherwise it will return the full contents of your Wygwam field.
:has_excerpt tagFor use in conditionals. Returns “y” if your Wygwam field has a “Read More” separator within it.
{wygwam_field:excerpt}
{if "{wygwam_field:has_excerpt}"}
<a href="{path='blog/full-posts/{url_title}'}">Read more...</a>
{/if}
:extended tagIf your field has a “Read More” separator, this returns the remaining portion of your Wygwam field contents after that point. Otherwise it won’t return anything.
<h1>{title}</h1>
{wygwam_field:excerpt}
<div class="extended">
{wygwam_field:extended}
</div>
If you pass the parameter text_only="yes" to Wygwam’s primary, :excerpt, or :extended tags, Wygwam will remove all the HTML tags from the content, leaving only the text.
{wygwam_field text_only="yes"}
If you pass the parameter images_only="yes" to Wygwam’s primary, :excerpt, or :extended tags, Wygwam will remove everything but the images from the content, and separate them with line breaks.
{wygwam_field images_only="yes"}
If you want to have complete control over the HTML output, use a tag pair:
<ul>
{wygwam_field images_only="yes"}
<li><img src="{src}" width="{width}" height="{height}" alt="{alt}" /></li>
{/wygwam_field}
</ul>
The following parameters are available to help customize the images-only output:
images_only="yes"delimiter=<br /> by default)offset=limit=The following variable tags are available within the tag pair:
{width}style= or width= HTML attributes (if the former, “px” will be removed){height}style= or height= HTML attributes (if the former, “px” will be removed){src}, {alt}, {title}, etc.){style:float}, etc.)