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

Best practice for index pages #189

Open
tm-kn opened this issue Aug 6, 2018 · 3 comments
Open

Best practice for index pages #189

tm-kn opened this issue Aug 6, 2018 · 3 comments

Comments

@tm-kn
Copy link
Collaborator

tm-kn commented Aug 6, 2018

I've been wondering what's the best practice for displaying variant pages that are children of an index page and are displayed on that index page. Currently the best solution in my opinion is to use utils.exclude_variant_pages on each queryset I want to display publicly, but it seems a bit tedious to do. Do you have any better ideas or options? Probably worth documenting as well.

@bmoe872
Copy link

bmoe872 commented May 16, 2019

I'm running into a similar requirement, but I am also curious if using that exlcude_variant_pages is the best approach.

@tm-kn
Copy link
Collaborator Author

tm-kn commented May 17, 2019

Sorry, I mean this - https://github.com/wagtail/wagtail-personalisation/blob/43b5b62e6021759a77671d36f7432ab10947ebff/src/wagtail_personalisation/utils.py#L101-L113

You can use that function to filter out the QuerySet from the variant pages, just display canonical pages. Variant pages should be not visible to users as separate pages.

@bmoe872
Copy link

bmoe872 commented May 17, 2019

@tm-kn yeah I figured that out pretty quickly after I sent the first post. Sorry about that. I edited my original, because I am also curious if that is best practice.

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

No branches or pull requests

2 participants