Could we help you? Please click the banners. We are young and desperately need the money
This post will explain you how to use acf to create custom back-end page. Acf enables to create very flexible template for a page.
ACF enables you to create many types of fields which are grouped in six groups(Basic, Content, Choice, Relational, Jquery, Layout).
We can create tabs, groups, repeaters and other layouts which constists of some types of fields from the rest of the groups. When we created fields, we made sure that item's id(Field Name) isn't the same like id of some other field. To get information from the field we use function get_field("field_name"[,"option"]). Argument "option" is optional, and we use it when we get information from the field from Team option template(Team option constist common information for every page).
When we want to take information from some group's field, we have to take group, like array of subfields with function get_field("name_of_group") and save that in some variable. That variable is associative array of subfields from that group and we get information like this:
var group = get_field("name_of_group"); var first_subfield = group["name_of_first_field"];
Repeater is very important field and it enables us to create something like loop in programming. Repeater consists of subfields like a group, but repeater enables us to create multiple groups of the same type. When we want to take information from some repeater's field, we have to take repeater field like array of more the same group. We get repeater with the same function like other fields
var repeater = get_fields("name_of_repeater"); var first_group = repeater[0];
We need to use loop(for, foreach, while) to get all of the fields from the repater like this:
foreach(repeater as group) { var first_field_in_group = group["field_name"]; /* ... */ }
We have more options to adjust fields. The field's width, class and id can be adjusted. The field can be required. Also we can limit the number of characters in the field, to set default value for some fields and more other options. Another very important option is that we can adjust conditional logic for some fields.
If conditional logic button is active, we can adjust logic when we can show that field.
Some options are, when another field: "has any value", "has no value", "value match pattern, "value contens value". And we can choose tamplate where we want to show or template where we won't show that field.