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.

Allow models to be revisioned, ordered, and editied through the admin without appearing in the explorer

See original GitHub issue

I don’t think it makes sense to think about all manageable models in terms of pages.

Wagtailmodeladmin gets us most of the way there. But what we don’t have, is the ability to create “things” in Wagtail that are also version controlled and rearrangeable. The workaround is to just let “things” be pages. But then you ​_have_​ to find a place for them in the Explorer. I don’t want that, though. I want them to be separate.

The problem is that pages are not what a website is comprised of, they’re how the website is delivered. This can change with technology – an API for instance won’t deliver content in terms of pages. It can also be confusing for content editors:

If a content editor wants to add a new team member, they shouldn’t have to go under “about > team”. They can click “team” in the left sidebar and add one right there. It could even have a cute “person” icon. How much more straightforward could it be?

I would rather not use "PersonPage"s for the sites I build. It’s just a Person.

Okay, so how about displaying the content? Ideally, with blocks. Every aspect of the page body is built by blocks. Want a listing of people? Add a “Team Block” to your body StreamField. The team block is just a placeholder block in the admin, maybe with some options. Then on the frontend it displays the team listing. This way you can create a StandardPage called “Team” and add a team block to it. Or for more granular control, have different StreamFields for different page types.

Need team members to have their own URLs? You could hard-code the section URL in Django, like: /person/$SLUG, where the slug is dynamic. This is fine for “things.” Cool URLs don’t change, anyway.

What do you think? I think this could simplify things a lot. All we need to make this happen now is a base class to inherit from, similar to Page, but that doesn’t appear in the Explorer. The admin side can be handled by Wagtailmodeladmin.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:5
  • Comments:34 (25 by maintainers)

github_iconTop GitHub Comments

2reactions
gasmancommented, Dec 11, 2017

Allowing non-page models to be versioned is still an open issue (but not one that we’re likely to get to in the short term).

2reactions
alexgleasoncommented, Apr 26, 2016

One way we could do this is to allow for multiple explorers.

class PageExplorer(Explorer):
    base_url = '/'
    icon = 'page'

class GrantsExplorer(Explorer):
    base_url = '/grants'
    max_depth = 1
    icon = 'grants'

class Page(models.Model):
    # ...
    allowed_explorers = ['PageExplorer']

class Grant(Page):
    # ...
    allowed_explorers = ['GrantsExplorer']

This would create a new explorer menu for “grants.”

In the database, a Grant would have a field storing the tree path (just as normal pages do). It would also have an explorer_id field which identifies which explorer the path is relative to.

This might not be the best design, just brainstorming.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage Device Installation with Group Policy - Microsoft Learn
The administrator wants to allow users to install only a small set of authorized USB devices while preventing any other USB device from...
Read more >
How to Allow Non-Admin Users to Start/Stop Windows Service?
Setting Windows Service Permissions Using the SC.exe (Service controller) Tool; Using the SubInACL to Allow a User to Start/Stop/Restart Service ...
Read more >
Allow Users to Save Revision History - Tableau Help
Allow Users to Save Revision History. Revision history enables your users to see how workbooks and data sources (content resources) have changed over...
Read more >
Changing the Pop-up Blocker Settings in Chrome, Firefox, or ...
Changing the Pop-up Blocker Settings in Chrome, Firefox, or Internet Explorer. Chrome. 1. On your computer, open Chrome. 2. At the top right,...
Read more >
FAQ - TortoiseSVN
Why is there no 'author' shown in the logs when I commit changes via svn+ssh? ... has been installed, you can use it...
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