wagtail-personalisation icon indicating copy to clipboard operation
wagtail-personalisation copied to clipboard

Best practice for index pages

Open tm-kn opened this issue 7 years ago • 3 comments

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.

tm-kn avatar Aug 06 '18 17:08 tm-kn

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

bmoe872 avatar May 16 '19 21:05 bmoe872

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.

tm-kn avatar May 17 '19 00:05 tm-kn

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

bmoe872 avatar May 17 '19 13:05 bmoe872