You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Partials and shortcode use a structured approach to validate their arguments. However, there is still quite a lot of boilerplate code to initialize the arguments. For example, the card-group partial uses about 30 lines of code to initialize the local variables based on the arguments passed to the partial.
Proposed solution
Refactor the utility function utilities/IsInvalidArgs.html defined in mod-utils to not only validate the arguments, but to initialize them too. Partials could then simply use them as map entries, unless they would need to override their values.
The text was updated successfully, but these errors were encountered:
In addition to the proposal, the arguments should support common definitions too. For example, the class arguments is defined in 30 data files. Using common definitions would improve standardization and limit rework.
Thirdly, the utilities/IsInvalidArgs.html partial should also support reading default values from the site configuration. The initialization order would be the following:
The value of the passed argument
The default value defined in the site parameters, identified by key
Problem or enhancement idea
Partials and shortcode use a structured approach to validate their arguments. However, there is still quite a lot of boilerplate code to initialize the arguments. For example, the
card-group
partial uses about 30 lines of code to initialize the local variables based on the arguments passed to the partial.Proposed solution
Refactor the utility function
utilities/IsInvalidArgs.html
defined inmod-utils
to not only validate the arguments, but to initialize them too. Partials could then simply use them as map entries, unless they would need to override their values.The text was updated successfully, but these errors were encountered: