Skip to content

MODX 3 Feature Request - Allow an alternative to context key 'web' on install. #14462

Open
@muzzwood

Description

@muzzwood

Feature request

Summary

MODX 2 currently relies on initialising the initial context with a key of web.
MODX 3 should allow renaming this.
I propose MODX 3 keep web as the default (for extras that rely on it) but optionally allow setting it to something else during install.

Why is it needed?

  • Multi-lingual sites would be much easier to manage if the language code matches the context key for one.
  • For multiple domain installations it would allow for meaningful keys.
    (There are potentially many more reasons but these are most relevant to me at least)

Suggested solution(s)

The ultimate solution would be to give contexts an id number as the primary key instead of a context key to be consistent with everything else, but I'm not sure how that'd be possible without breaking backwards compatibility completely. Perhaps also keep the context key field for the interim with an index on it, yet switch to the pk of id?

The second best solution would be to allow context keys to be changeable at any time however that presents a problem of how to initialise a context in the first place allowing MODX to load. (Actually, id numbers as pk would be better here because you could just $modx->initialize(1);)

The other solution would only allow the one-time change on install. Where if the default of web is changed in setup, the installer would modify the initialization code accordingly. After this, it couldn't be changed.

If this is something that was looked at before and put in the too hard basket, feel free to close this. Otherwise, what are people's thoughts on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-setupblockedActive participation around the pull request or issue required. Consensus is not reached.featureRequest about implementing a brand new function or possibility.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions