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.

Screenshot of GB Default Value settings page

Screenshot of GB Default Value on field settings

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: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}
  • {author: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.

Changelog

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.

LinkedIn pictogram Instagram pictogram