In a previous video, we saw the definition of an input field and explained how the user can apply this tool to enter some data in our template. Today we are going to deep dive into this concept a bit more and explain some of the syntax around it.
Custom: the word “custom” indicates that we are creating our variable in the “custom” drop. This cannot be changed.
Namespace: word of our choice. It should be descriptive enough and represent the group/category (e.g. if we want the user to enter the employee’s id, “employee” would be a great namespace)
Key: word of our choice. It should be descriptive enough and represent the object inside the aforementioned category (e.g. if we want the user to enter the employee’s id, “id” would be a great key)
The combination of namespace and key should be unique per template.
When we create input fields that are attached to a certain collection in a fori loop, the custom.namespace should be replaced with the key of the loop that acts as an alias.
Unlike the variables created using assign, input variables can be accessed before we defined them. This is possible because they are stored in the database and not just in the template itself.
Updated 4 months ago