LiveWhale comes with functionality that allows visitors to your public web site to suggest news stories, events, and images to your website (or just events, in the case of LiveWhale Calendar). These items are added to a special “Public” group in the back-end for you to review, edit, and publish when ready.
Publicly submitted data will not show up on the public web site unless:
<arg id="show_public">true</arg>
)A default event submission form is included with Livewhale and LiveWhale Calendar at /livewhale/theme/core/templates/submit_event.php, which you can copy, edit, and include in your website. The form will include captchas if configured for your site.
There are a set of default form fields that are included in this form. Here is the full set of supported fields:
Field | Name | Notes |
---|---|---|
Contact Name (required) | name | |
Contact Email (required) | ||
Title (required) | event_title | |
Start Date (required) | event_date | Add class="lw_date" for datepicker |
Start Time | event_time | Add class="lw_time" for timepicker |
End Date (LiveWhale 1.7+) | event_date2 | Add class="lw_date" for datepicker |
End Time | event_time2 | Add class="lw_time" for timepicker |
Summary (LiveWhale 1.7+) | event_summary | Supports multiple lines with <textarea> |
Description | event_description | Supports multiple lines with <textarea> |
Contact Info | event_contact_info | Supports multiple lines with <textarea> |
Cost (LiveWhale 1.7+) | event_cost | Added as cost type “Other,” supports multiple lines with <textarea> |
Location | event_location | |
Web Address | event_location | Added as Related Content |
Event Types | Use <xphp var="event_types"/> |
Selector will only show starred event types |
Tags | event_tags | Separated by commas |
Photo | Use <input type="hidden" class="lw_upload"/> or <input type="hidden" class="lw_image_upload"/> in LiveWhale 1.7.1+ |
|
Photo Caption | event_image_caption | |
Photo Keywords | event_image_keywords | |
Photo Credit | event_image_credit | |
Submit to calendar (if configured) | submission_group | |
Online Events (LiveWhale 1.7.1+) | See Online Events documentation for fields | |
File Attachment (LiveWhale 1.7.1+) | Use <input type="hidden" class="lw_file_upload"/> |
Uploaded file will be attached as related content |
Advanced: Create and accept your own custom submission variables using the onAfterPublicSubmission handler.
A default news submission form is included with Livewhale at /livewhale/theme/core/templates/submit_news.php, which you can copy, edit, and include in your website. The form will include captchas if configured for your site.
Or, you can model a news story submission form after the default event submission form, removing the date, time, and event type fields and substituting in the following field names:
news_headline
)news_summary
)news_body
)news_tags
)lw_upload
code)news_image_caption
)news_image_credit
)news_image_keywords
)and editing the form action to <form method="post" action="/live/public/submit/news">
.
A default image submission form is included with Livewhale at /livewhale/theme/core/templates/submit_image.php, which you can copy, edit, and include in your website. The form will include captchas if configured for your site.
Or, you can model an image submission form after the default event submission form, removing everything except the following fields:
lw_upload
code)image_description
)image_caption
)image_credit
)image_keywords
)and editing the form action to <form method="post" action="/live/public/submit/image">
.
By default, all content will be submitted to the “Public” group. You may choose to send news and events to other groups (images must always go to the “Public” group for approval) using the below options.
You can set one group for all submissions by editing the HTML form to include<input type="hidden" name="submission_group" value="123" \>
and replacing 123 with the group ID of your chosen group.
Or, you might want to submit to the current group of wherever you’ve included the form. You can use <input type="hidden" name="submission_group" value="<xphp var="group_gid" \>
in the HTML form to do that.
Or, you can have your users choose which group to submit to. Find the widget type="public"
in the HTML form and use the following option:
1 | <widget type="public" priority="high"> |
then, add to your form
1 | <tr> |
This will show a drop-down menu of all groups. To choose which groups should be available in that drop-down, edit the public LiveWhale config (/livewhale/client/public.config.php) and set
$_LW->CONFIG['PUBLIC_GROUPS']=[123, 124, 125];
to include only the group IDs you want.
Since LiveWhale 1.7, you can instead configure a list of groups you don’t want included in the drop-down, if that’s easier than having to add new groups to the PUBLIC_GROUPS array:
$_LW->CONFIG['EXCLUDE_PUBLIC_GROUPS']=[200, 201, 202];
By default, name and email are required fields for all public submissions. If you submit an image, caption is required. You can require additional fields in your public submission form by adding a custom validation handler.
If you’re submitting to the “Public” group: You can choose who will receive email notifications of public submissions by editing the global LiveWhale config (/livewhale/client/public.config.php) and setting
$_LW->CONFIG['PUBLIC_NOTIFICATIONS_EMAIL']='';
If you’re submitting to another group: Anyone who can publish dynamic content in a group (i.e., Publishers, Curators, and Administrators in LiveWhale Calendar) will be sent notifications when a story or event has been submitted to their group.
Since LiveWhale 1.7, you can send your visitors an email confirmation of their submission by setting the form field send_email
in your form. You can allow them to choose to receive it with a checkbox.
1 | <label> |
Or use a hidden input to send the email for all submissions.
1 | <!-- always send a confirmation email --> |
Since LiveWhale 1.7, you can set (or override) a custom thank you page on a per-form basis by adding a hidden input “thanks_url” to the form itself:
<input type="hidden" name="thanks_url" value="https://myschool.edu/thanks" />
To set a global thank you page for all public submission forms, open the public LiveWhale config (/livewhale/client/public.config.php) using an FTP client or via the command line. To specify the URL you should be taken to after filling out a public submission form, enter it like this:
$_LW->CONFIG['PUBLIC_THANKS_URL']='/thanks.php';
If none is supplied, the default is /_ingredients/templates/details/submit_thanks.php.
In LiveWhale 1.7.1 and before, locations were entered as plain text:
1 | <input type="text" name="event_location" id="event_location"/> |
In LiveWhale 1.8+, you now have the option to offer a dropdown of saved locations that users can choose from.
1 | <xphp var="locations" /> |
This dropdown will, by default, show all available locations as well as an “Other” option that opens a free text field to add your own location.
option.location_other
via CSS.<arg id="locations_group">My Group</arg>
to the <widget type="public">
settings at the top of the submission form. In fact, any settings that begin with locations_
in that space will be passed through to the widget that generates <xphp var="locations" />
.<widget type="locations">
code instead of the saved XPHP variable, basing it on the contents of /livewhale/core/modules/public/public.widget.public.phpIn LiveWhale 1.7.1 and before, tags were entered as plain text:
1 | <input type="text" name="event_tags" id="event_tags"/> |
In LiveWhale 1.8+, you now have the option to offer checkboxes of saved tags that users can choose from.
1 | <xphp var="tags" /> |
These checkboxes will, by default, show all available tags as well as an “Other” option that opens a free text field to add your own location.
li.tag_other
via CSS.<arg id="tags_group">My Group</arg>
to the <widget type="public">
settings at the top of the submission form. In fact, any settings that begin with tags_
in that space will be passed through to the widget that generates <xphp var="tags" />
.<widget type="tags">
code instead of the saved XPHP variable, basing it on the contents of /livewhale/core/modules/public/public.widget.public.phpYou may have custom fields on your events, news, or images, and you can also receive values for those custom fields using your public submission forms.
In LiveWhale 1.7+, you can add inputs to your form with name="custom_my_variable_name"
and LiveWhale will automatically set the custom field “my_variable_name” with that value for any inputs prefixed with custom_
.
In LiveWhale 1.6.2 and before, receiving and setting custom fields is done using the onAfterPublicSubmission handler in a custom module.