Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide for additional variable modifier traits to be registered by add-ons #1203

Closed
1 task done
jcogs-design opened this issue Jul 20, 2021 · 0 comments · Fixed by #2613 or #3046
Closed
1 task done

Provide for additional variable modifier traits to be registered by add-ons #1203

jcogs-design opened this issue Jul 20, 2021 · 0 comments · Fixed by #2613 or #3046
Labels
community feature Someone from the community is willing to work on this

Comments

@jcogs-design
Copy link
Contributor

jcogs-design commented Jul 20, 2021

Is your feature request related to a problem? Please describe.
n/a

Describe the solution you'd like
The variable modifier system is a useful addition / improvement over tag based variable modification in some use cases.

Currently these modifications are defined as traits in the file /system/ee/ExpressionEngine/Service/Template/Variables/ModifiableTrait.php and there is no (obvious at least) way for add-ons to extend this list.

For some add-ons the ability to extend the list would provide user benefits similar to those that are obtained from the existance of the current traits.

It may be that there is an (undocumented) method that could be used to extend this list - if so if it can be described then I'd happily add this explanation to the current docs.

If there is not, one solution would be replace the current hard-wired list with code that reads defined traits from a table or config file or similar, and include in this the option to read additional traits from a separate table containing additional traits defined by add-ons. Then a mechanism to support the registration of new traits could be added to the add-on setup process, and add-ons could add their own variable modifiers to EE...

Describe alternatives you've considered
Add-ons can carry on using single / double tags as currently.

Teachability, Documentation, Adoption, Migration Strategy
User teachability / documentation would be covered by documentation provided by add-on developers who would like to use the system. However some additional developer documentation would be required to document the mechanism of defining / registering additional traits.

The change in approach would not necessarily have any impact on existing function of EE, so there should be no compatability issues or need for a migration strategy.

  • I am capable and would like to help with implementation of this feature if it is considered (but I would need some guidance from better minds about preferred method of implementing if idea is accepted etc.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community feature Someone from the community is willing to work on this
Projects
None yet
2 participants