Freeform 3.x

Legacy documentation for Freeform 3.x.

The Freeform:Entries tag allows you to display Freeform entries that have been submitted to your site via the Freeform:Form tag. This can be a single entry view, or a list of entries.

{exp:freeform:entries} content {/exp:freeform:entries} 

Parameters

The following parameters are available for use:

dynamic=

dynamic="off" 

Freeform looks for an entry ID in the URL in order to pull a specific Freeform entry. This can be disabled by providing off as the value of this parameter.

entry_id=

entry_id="{segment_3}" 

This parameter allows you to display a specific Freeform entry by specifying its entry ID. If there's an ID in the URI, and the dynamic parameter is not set to no, Freeform will automatically serve an entry matching that ID. You can hardcode an entry ID, pass it through an embed, or grab it from the URI.

collection=

collection="Cheese Survey" 

This parameter allows you to filter your results by the dynamic collection name given to your Freeform entries. Formerly known as form_name in previous versions of Freeform.

limit=

limit="10" 

This parameter allows you to limit the amount of results returned. The default is 20.

orderby=

orderby="entry_date" 

This parameter is how you order your entries. You can order your entries by date or any custom Freeform field name.

sort=

sort="asc" 

This parameter lets you set the direction to sort your entries: asc or desc.

status=

status="open|closed" 

This parameter allows you to filter entries by status. If not specified, Freeform will display entries in open status only. Separate multiple statuses with the pipe character.

Variables

The following variables are available for use:

attachment_count

{attachment_count} 

This variable will output the number of attachments uploaded at the time of form submission for the entry.

author_id

{author_id} 

This variable will display the member ID of the form submitter IF they were logged in when they submitted the form.

collection_name

{collection_name} 

This variable will output the collection name used at the time of submission. Formerly known as form_name in previous versions of Freeform.

count

{count} 

This variable outputs the display order number for each result in the list of entries.

edit_date

{edit_date format="%F %j, %Y at %g:%i %a"} 

This variable will display the date the Freeform entry was last edited. If the entry has not been edited, this variable will not output anything. This variable should be formatted using standard EE date formatting.

entry_date

{entry_date format="%F %j, %Y at %g:%i %a"} 

This variable will display the date the Freeform entry was submitted. This variable should be formatted using standard EE date formatting.

entry_id

{entry_id} 

This variable will display the unique ID for the Freeform entry.

gmt_edit_date

{gmt_edit_date format="%F %j, %Y at %g:%i %a"} 

This variable will display the GMT version of the date the Freeform entry was last edited. If the entry has not been edited, this variable will not output anything. This variable should be formatted using standard EE date formatting.

gmt_entry_date

{gmt_entry_date format="%F %j, %Y at %g:%i %a"} 

This variable will display the GMT version of the date the Freeform entry was submitted. This variable should be formatted using standard EE date formatting.

group_id

{group_id} 

This variable will be display the Member Group ID of the form submitter IF they were logged in when they submitted the form.

ip_address

{ip_address} 

This variable will be display the IP Address of the form submitter.

reverse_count

{reverse_count} 

This variable outputs the display order number for each result in reverse order in the list of entries.

switch

{switch="style_one|style_two"} 

This variable allows you to switch a CSS class back and fourth for all outputted results.

total_entries

{total_entries} 

This variable will output the total number of entries that were found meeting your filtering criteria.

template

{template} 

This variable will be replaced by the Freeform Admin notification template used at the time of form submission.

FREEFORM_FIELD_NAME

{FREEFORM_FIELD_NAME} 

All Freeform fields as available in the Freeform CP are available for use as variables here to display submitted data. To display a Freeform fields' data, just specify the short_name of the field (ex: subject).

Variable Pairs

The following variable pairs are available for use:

attachments

{attachments}{/attachments} 

This variable pair allows you to establish the formatting and placement of the attachment variables for each Freeform entry. Variables available within this variable pair are:

  • {emailed} - returns y or n, depending on whether or not an attachment was emailed to someone or was just saved to the server at the time the Freeform entry was submitted.
  • {extension} - displays the extension type for the file (ex: .pdf)
  • {filename} - displays the name of the file (ex: proposal)
  • {filesize} - displays the size of the file in KB's (ex: 36KB)
  • {fileurl} - displays a full URL of the file (ex: http://www.site.com/images/uploads/proposal.pdf)
  • {server_path} - displays the full server path to the directory containing the file (ex: /www/name/public_html/images/uploads/)

Conditionals

Conditionals are available on all of the variables above. Additionally, these exist as well:

if no_results

{if no_results}Sorry, no results were found.{/if} 

This conditional evaluates to true and displays it's contents when there are no results found for this tag.

Examples

The following is a basic example of how you can display a simple list of submitted Freeform entries:

<ul>
{exp:freeform:entries
    collection="Cheese Survey"
    orderby="name"
    sort="asc"
    limit="20"
}
<li><b>{name}</b> - {email}</li>
{if no_results}<li>No Results</li>{/if}
{/exp:freeform:entries}
<ul>

The following is a slightly more advanced example of how you can display several details of a submitted Freeform entry:

{exp:freeform:entries
    collection="Contact Form"
    orderby="date"
    sort="desc"
    limit="20"
}

<p>Submitted: {entry_date format="%F %j, %Y at %g:%i %a"}</p>
<h3>By: {name} {if urgent == "yes"}[URGENT]{/if}</h3>
<p>Email Address: {email}</p>
<p>Home Phone: {phone1}</p>
{if phone2}
<p>Cell Phone: {phone2}</p>
{/if}

<p>Subject: {subject}</p>
<p>Questions or Comments:<br />{question}</p>
<p>{attachment_count} Attached File(s):
    <ul>
        {attachments}
        <li><a href="{fileurl}">{filename}{extension} ({filesize}KB)</a></li>
        {/attachments}
    </ul></p>

{if no_results}
<p>No results found.</p>
{/if}

{/exp:freeform:entries}