question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add 'tree_navigable' option to PageChooserPanel and PageChooserBlock

See original GitHub issue

The ability to limit PageChooserPanel choices to instances of a specific page type was a welcome addition and works beautifully when those page types can exist in multiple locations throughout the site. However, it’s often the case that certain page types only live under a single page (e.g. events, news articles, blog posts etc), in which case, starting at the root level of the explorer-like listing is not ideal.

I propose a tree_navigable option be added to PageChooserPanel and PageChooserBlock to give developers the option to specify whether the chooser should render as it does currently (the default option), or whether is jumps straight into a list of pages that match the specified type(s) (with the most recently modified pages appearing first)

The search function within the widget already limits the results to those that match the type, so that wouldn’t need to change. I also think it would be possible in this case to ditch the message above the list.

Any thoughts?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
ababiccommented, Jun 22, 2016

I certainly like the idea of automatically choosing a better starting point based the queryset, but It’s still valuable as a developer to be able to have that extra level of control. Plus, the automated option still might not be optimal. For example:

Say you want the editor to be able to pick an Article, but Articles are dotted around under numerous listing pages throughout the tree. It’s probably of little importance to the editor where the article lives, so navigating through the tree might not make sense to them in that context. If using ModelAdmin (especially with exclude_from_explorer=True - #2771 ), they might not even be aware that articles are part of the tree - they manage them all from the same listing page in the CMS.

There are other benefits to be gained also: such as getting rid of the (likely unselectable) parent page at the top, and even ditching the rightmost column (used to navigate to children) to give the listing more space. The warning too (that appears currently) can also be ditched, because they won’t see any other types of page in that listing.

0reactions
m1kolacommented, Jan 19, 2018

There is a related issue: #1806. Also see this comment.

Probably generic chooser with the UI similar (or even exactly the same) as for snippet chooser will solve this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom StreamField Field Validation - LearnWagtail.com
When you want to create a custom link in a StreamField, a lot of times we'll give people the option select an existing...
Read more >
PageChooserBlock questions - Google Groups
I have set a related name for the PageChooserBlock, but can't seem to access it in my lookups as it lives within the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found