# JSON-T Predicates
Predicates are special [Directives](/json-t-directives) used like sections, except they don't correspond to a variable in the context. They allow you to test for certain system defined features.

The format for a predicate is `{.predicate-name?} ... {.end}`. You can generally spot a predicate by the trailing question mark.

## Collection Predicates
These tags are used in collection template files (`.list`, `.item`).

### Main Image Predicate
```html
{.main-image?}
  <!-- code here -->
{.end}
```
Tests the presence of a Main Image for a collection or item.

### Excerpt Predicate
```html
{.excerpt?}
  <!-- code here -->
{.end}
```
Tests the presence an excerpt for an item.

### Comments Enabled Predicate
```html
{.comments?}
  <!-- code here -->
{.end}
```
Tests if comments are enabled for a particular item.

### Disqus Enabled Predicate
```html
{.disqus?}
  <!-- code here -->
{.end}
```
Test is Disqus comments have been enabled (only useful in items with comments enabled).

### Video Predicate
```html
{.video?}
  <!-- code here -->
{.end}
```
Tests if an item within a Gallery Collection is a video.

### Even Predicate
```html
{.even?}
  <!-- code here -->
{.end}
```
Tests if an item's index position is even.

### Odd Predicate
```html
{.odd?}
  <!-- code here -->
{.end}
```
Tests if an item's index position is odd.

### Equal Predicate
```html
{.equal? arg1 arg2}
  <!-- code here -->
{.end}
```
Tests if two alpha-numeric arguments are equal. If true, anything between the condition `{.equal?}` and `{.end}` will be output. If either of your arguments may contain spaces, use a delimiter other than a space to ensure an accurate return. For example: `{.equal?:arg1:arg2}`.


## Navigation Predicates
These predicates are only used within navigation (`.block`) files.

### Collection Predicate
```html
{.collection?}
  <!-- code here -->
{.end}
```
Tests if a navigation item is a collection.

### External Link Predicate
```html
{.external-link?}
  <!-- code here -->
{.end}
```
Tests if a navigation item is an external link.

### Folder Predicate
```html

{.folder?}
  <!-- code here -->
{.end}
```
Tests if a navigation item is a folder.
