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

Option to show only a single section at a time (take them as distinct tabs) #314

Open
techpet opened this issue May 9, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@techpet
Copy link

techpet commented May 9, 2022

Expected behavior: Section component should wrap it's children inside a Tab and show/hide them when the tab is active.

Issue: Children components are displayed inline, just after previous section children components.

Case: Screenshot from cider-house example:

image

@VojtaStanek
Copy link
Contributor

Hi techpet!

Thanks for your interest in Contember Admin and for taking your time to open this issue!

This is expected behaviour, we believe it's the better default. I agree that on the presented screenshot it looks odd - this is usable, especially on long pages - e.g. article edit page, where there is the content of the article and below there is some setting for SEO / meta tags.

There are several ways you can achieve the behaviour you want:

  • You can create a seperate page for each section and add link buttons like this: <EditPage rendererProps={{ afterTitle: <>Buttons here</> }}.
  • If you need it on the same page, you can do it by using lower-level components like DataBindingProvider, EntitySubTree and LayoutRenderer in a custom stateful component.

I am converting this issue into a feature request for the behaviour you expected.

@VojtaStanek VojtaStanek added the enhancement New feature or request label May 10, 2022
@VojtaStanek VojtaStanek changed the title Section component does not properly hide/show children components Option to show only a single section at a time (take them as distinct tabs) May 10, 2022
@techpet
Copy link
Author

techpet commented May 10, 2022

Thank you for your reply @VojtaStanek! Indeed, one can achieve this functionality with the very reasonable ways that you have proposed. It's great that Contember has all the flexibility that allows you to think out of the box and apply several different solutions to a problem!

In my mind, the default expected behaviour of the headings (tabs) placed on top with the ability to change the active one would be either to navigate you to hidden content or work as anchor links to the related Section content. But again, that might be just me thinking of this as the default behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants