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.

adding a max_count for a child page?

See original GitHub issue

I would like the ability to have the max_count on a specific child.

for example i have a Page with child pages, each of the child pages can have 1 detail page of their own and many other types of pages.

here is an example of what i mean. Apologies if its difficult to understand what im trying to ask.

class MainPage(PagePlus):
    text = RichTextField()

    content_panels = Page.content_panels + [
        FieldPanel('text'),
    ]

    parent_page_types = ['HomePage']


class DetailPage(PagePlus):
    pass
    parent_page_types = ['MainPage']
    max_count_per_child = 1 <<<<<<<<<<<<<<<<<<<<<

class AnotherPage(Page):
    pass
    parent_page_types = ['MainPage']

now in the CMS it would work similarly to the newly added max_count, but only allow 1 detail page per child created. currently if i added the max_count it would allow me to make 1 detail page accross all the child pages, but i would like 1 detail page per child page.

Just a possible addition that could help in some specific cases.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JaredOzzycommented, Mar 15, 2019

I hope I didn’t take the work from you, but I really wanted to try this out!

Not at all! glad you got it working, will be using your work once its live! 😉

1reaction
leewesleyvcommented, Mar 15, 2019

I hope I didn’t take the work from you, but I really wanted to try this out!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wagtail CMS: Restricting Parent and Child Page Types
When you start to create several different page types in Wagtail and you create a child page (a page that's nested under a...
Read more >
Insert the children display macro | Confluence Cloud
Use the Children Display macro to insert a list of a page's child pages, and their descendants. This is useful, for example, if...
Read more >
display specific top level and child pages in wordpress
When on Page 1, I want to show Page 1 and all the child pages below on a menu, when on a child...
Read more >
How to Create a Child Page in WordPress - WPBeginner
To create a child page, you first need a parent page. You can use any page as a parent, or create a new...
Read more >
Max Input Vars – Uncode Theme
The PHP Max Input Vars is the maximum number of variables your server can use for a single function. To work properly with...
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