GB Default Value
Dynamically specify default values for text fields or file names for files. You can use the field values, categories, and/or author member fields from the entry to generate the default values.
Installation
Upload the folders to the respective system/user/addons/
and themes/user/
directories and click install on the Add-Ons page.
Usage
There are 2 places where you can specify the default value. - The GB Default Value settings page - Field settings page
Channel
Set the channel for this default value rule to be applied to for the specified field.
Field
Set the field to have the default value rule.
Title and URL Title
You can use other fields to dynamically generate the values Title and URL Title field. I’m using jQuery to remove the validation process on those 2 fields so if the validation is still happening, it might be because there is something wrong with the extension script.
Value
This is like a template. You can use {exp:channel:entries}
loops or {embed="templates"}
to set the values. To access the field values, categories and author member fields from the entry, you can prefix your tag with this like {this:entry_id}
, {this:title}
, {this:custom_field}
, {this:categories backspace="1"}{category_id},{/this:categories}
, {author:member_id}
, {author:member_field_short_name}
.
{this:categories}
{active}
{category_count}
{category_description}
{category_group}
{category_id}
{category_image}
{category_name}
{category_url_title}
{parent_id}
Author information
{author:member_id}
{author:email}
{author:username}
{author:screen_name}
{member_custom_field}
Force?
Do you want the default value rule to kick in even if the field is not empty? For file fields, you must toggle this on for the file names to be changed.
Run on updating entry?
A lot of people has asked for this so I’m enabling this. If you want the default value to kick in even when an entry is being updated, toggle this on. You may need to turn Force? on to overwrite the existing values. Title and URL Title excluded. For files, the file name will be updated.
Note
gbdefaultvalueplacehoder
is a reserved value for Title and URL Title fields
Changelog
1.1.1
Added
- Generate the URL Title if Title has a default value set
Fixed
- First entry ID generation
- Temp value not clearing
1.1.0
Fixed
- Title and URL Title options when toggling channels in Rule Settings
Updated
- EE Template syntax highlighter in Rule Settings
Added
{this:entry_id}
now available- Added Run on updating entry? toggle
- Jump Menu functionalities
1.0.0
- Hello World!
Support
Email Gilbert at gilbert.lin.web@gmail.com
License
Updated: February 6th, 2021
PERMITTED USE
ONE LICENSE GRANTS THE RIGHT TO PERFORM ONE INSTALLATION OF THE SOFTWARE. EACH ADDITIONAL INSTALLATION OF THE SOFTWARE REQUIRES AN ADDITIONAL PURCHASED LICENSE. FOR FREE SOFTWARE, NO PURCHASE IS NECESSARY, BUT THIS LICENSE STILL APPLIES.
RESTRICTIONS
UNLESS YOU HAVE BEEN GRANTED PRIOR, WRITTEN CONSENT FROM GILBERT LIN, YOU MAY NOT:
- REPRODUCE, DISTRIBUTE, OR TRANSFER THE SOFTWARE, OR PORTIONS THEREOF, TO ANY THIRD PARTY.
- SELL, RENT, LEASE, ASSIGN, OR SUBLET THE SOFTWARE OR PORTIONS THEREOF.
- GRANT RIGHTS TO ANY OTHER PERSON.
- USE THE SOFTWARE IN VIOLATION OF ANY CANADA OR INTERNATIONAL LAW OR REGULATION.
DISPLAY OF COPYRIGHT NOTICES
ALL COPYRIGHT AND PROPRIETARY NOTICES AND LOGOS IN THE CONTROL PANEL AND WITHIN THE SOFTWARE FILES MUST REMAIN INTACT.
SOFTWARE MODIFICATION
YOU MAY ALTER, MODIFY, OR EXTEND THE SOFTWARE FOR YOUR OWN USE, OR COMMISSION A THIRD-PARTY TO PERFORM MODIFICATIONS FOR YOU, BUT YOU MAY NOT RESELL, REDISTRIBUTE OR TRANSFER THE MODIFIED OR DERIVATIVE VERSION WITHOUT PRIOR WRITTEN CONSENT FROM GILBERT LIN. THE MODIFICATIONS BY YOU OR THE COMMISSIONED THIRD-PARTY MAY NOT INFRINGE AND/OR VIOLATE GILBERT LIN’S LICENSE RIGHTS. COMPONENTS FROM THE SOFTWARE MAY NOT BE EXTRACTED AND USED IN OTHER PROGRAMS WITHOUT PRIOR WRITTEN CONSENT FROM GILBERT LIN.
DISCLAIMER OF WARRANTY
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF QUALITY, PERFORMANCE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. FURTHER, GILBERT LIN DOES NOT WARRANT THAT THE SOFTWARE OR ANY RELATED SERVICE WILL ALWAYS BE AVAILABLE.
LIMITATIONS OF LIABILITY
YOU ASSUME ALL RISK ASSOCIATED WITH THE INSTALLATION AND USE OF THE SOFTWARE. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS OF THE SOFTWARE BE LIABLE FOR CLAIMS, DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE. LICENSE HOLDERS ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USE AND ASSUME ALL RISKS ASSOCIATED WITH ITS USE, INCLUDING BUT NOT LIMITED TO THE RISKS OF PROGRAM ERRORS, DAMAGE TO EQUIPMENT, LOSS OF DATA OR SOFTWARE PROGRAMS, OR UNAVAILABILITY OR INTERRUPTION OF OPERATIONS.