Skip to content

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

Description

@jcogs-design

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    community featureSomeone from the community is willing to work on this

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions