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

How are variants chosen where there are multiple matching segments? #204

Open
mattlinares opened this issue Oct 3, 2019 · 0 comments
Open

Comments

@mattlinares
Copy link

mattlinares commented Oct 3, 2019

If a page has multiple segment variants and a user matches more than one of those segments, how does the module choose which variant to show to the user? This is not stated anywhere that I can see in the docs.

I think it occurs inside of:

@hooks.register('before_serve_page')
def serve_variant()

on line 118 of wagtail_hooks.py:

variant = metadata.first().variant.specific

but that seems a little arbitrary as it just picks the first variant in the list. There is a TODO in that may refer to this issue but is a little unclear.

Anyway, if this is the case, it would be good to mention it in the docs. I'd be happy to add that to the docs if we can clarify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant