{% extends 'base.html.twig' %} {% block title %} Fekara | Custom Fields {% endblock %} {# add extra css here, if require #} {% block ExtraCSSFiles %} {% endblock %} {% set pagename = 'Custom Fields' | trans %} {% set addBtnTitle = 'Add New Field?' | trans %} {% set addBtnLink = path('add_custom_fields') %} {% block showHeaderMenuButtons %}
{% endblock %} {% block MainContent %} {# Section of custom fields #}

{{ 'Sections'|trans }}

{# Default section #} {# User's saved sections #} {% for f_s in fieldsSection %} {% if f_s.id != 1 %} {% endif %} {% endfor %}
{{ 'Name'|trans }} {{ 'Description'|trans }} {{ 'No, of fields'|trans }} {{ 'Actions'|trans }}
{{ 'More Information' | trans }} {{ 'This is the default section, Uncategories field will display here'|trans }} {{ noOfFieldInDefaultSection|length }}
{{ f_s.name }} {{ f_s.description }} {{ f_s.getCustomFieldRef() | length }}
{# List of Custom Fields #}

{{ 'Custom Fields'|trans }}

{% for field in fieldsLIst %} {# some twig variables #} {# show this field to these specific roles. #} {% set visible_to = field.getVisibleTo()|split(',') %} {# show this field to specific roles of registration form #} {% set visible_in = field.getVisibleToRegistrationFormOf()|split(',') %} {# this field visible to following roles. #} {% endfor %}
{{ 'Name'|trans }} {{ 'Type'|trans }} {{ 'Accessible to'|trans }} {{ 'Registration form'|trans }} {{ 'Require'|trans }} {{ 'Actions'|trans }}
{{ field.label }} {{ field.type }} {% if in_array('1', visible_to) %} Student, {% endif %} {% if in_array('2', visible_to) %} Teacher, {% endif %} {% if in_array('3', visible_to) %} Guardian, {% endif %} {% if in_array('4', visible_to) %} Employee, {% endif %} {% if in_array('1', visible_in) %} Student, {% endif %} {% if in_array('2', visible_in) %} Teacher, {% endif %} {% if in_array('3', visible_in) %} Guardian, {% endif %} {% if in_array('4', visible_in) %} Employee, {% endif %} {% if field.is_require %} {{ 'Active' | trans }} {% else %} {{ 'InActive' | trans }} {% endif %}
{% endblock %} {% block ExtraJsFIles %} {% for file in encore_entry_js_files('viewCustomFields') %} {% endfor %} {% endblock %} {% block documentation %}
Custom Fields?

Custom fields are designed because, many schools has different criteria to ask information from students. so this application is asking basic information from the Students, Teachers & Employees
Here we are having of all the Custom fields, All custom fields are must be in the Section, try to add new section

From here, We can see the List of Custom Field Sections and Custom Fields, this page is divided into two segments

{% endblock %}