1. Home
  2. Docs
  3. Flexi Gallery
  4. Tutorial
  5. Custom field

Custom field

Flexi has option to add own custom fields. Custom fields is a field which we collect by user through submission form and display it at gallery & detail page.

For example, you want to get information like location & date along with common field. This two field is not available as ready input field but we can generate it with the help of [flexi-form] shortcode.

We will generate a submission form contains
1- Title of the Image
2- Category
4- Image Upload
3- Location
4- Date of Image
5- Submit button

Below is the shortcode used to display form with required field.

[flexi-form class="pure-form pure-form-stacked" title="Submit" name="my_form" ajax="true"]
[flexi-form-tag type="post_title" title="Title" value="" placeholder="main title" required="true"]
[flexi-form-tag type="category" title="Select category" ]
[flexi-form-tag type="text" name="flexi_field_1" title="Location"]
[flexi-form-tag type="other" new_type="date" name="flexi_field_2" title="Date"]
[flexi-form-tag type="file" title="Select file"]
[flexi-form-tag type="submit" name="submit" value="Submit Now"]
[/flexi-form]

As you can see Flexi has some reserved name field which are flexi_field_1 to flexi_field_10 and it compulsory to assign only between these range. You cannot keep name as location for above example, as it is unknown by Flexi. Hence here location name is given as flexi_field_1 and date name is flexi_field_2. You should remember what name is given for the field name.

From settings you can mange where to display these fields. For that you must enable at Flexi settings –> Extension tab

After you enable it you will see a new section Flexi Custom Field at Flexi Settings –> Form Tab as like the screenshot below.

Here will have 10 different custom field (3 field for Free version) will appear. Via settings you can define where to display these custom fields.
It is not necessary that all field will be visible at gallery page due to limited space but detail page will have all the fields.
For example lightbox will only display flexi_field_1 value and ignore rest, similarly “wide gallery layout” can only 2 custom field.

Field displayed at detail page
Field displayed at wide gallery layout

Leave a Reply