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

Nav blueprint sections should hide when empty #11359

Open
robdekort opened this issue Jan 15, 2025 · 3 comments
Open

Nav blueprint sections should hide when empty #11359

robdekort opened this issue Jan 15, 2025 · 3 comments

Comments

@robdekort
Copy link
Contributor

robdekort commented Jan 15, 2025

Bug description

If you use conditions on navigation blueprint fields, you'd probably expect blueprint sections to auto-hide whenever there's no fields in it, just like in collection blueprints (#9137).

Screenshot 2025-01-15 at 15 57 28

Feel free to move this to the ideas repo, technically it is a FR.

How to reproduce

  1. Create a section in a nav blueprint.
  2. Make a conditional field.
  3. See the empty section when the condition doesn't pass.

Logs

No response

Environment

Environment
Application Name: De Kinderacademie
Laravel Version: 11.37.0
PHP Version: 8.2.27
Composer Version: 2.8.4
Environment: local
Debug Mode: ENABLED
URL: dekinderacademie.test
Maintenance Mode: OFF
Timezone: Europe/Amsterdam
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 4
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.45.1 PRO

Statamic Addons
studio1902/statamic-peak-browser-appearance: 3.6.0
studio1902/statamic-peak-commands: 8.15.1
studio1902/statamic-peak-seo: 8.19.0
studio1902/statamic-peak-tools: 6.6.0

Installation

Starter Kit using via CLI

Additional details

No response

@duncanmcclean
Copy link
Member

Strange... sections seem to be hiding/showing correctly for me:

CleanShot 2025-01-16 at 10 53 10

Are there any console errors?

@robdekort
Copy link
Contributor Author

Ah gotcha, this makes me realize my setup is a bit different as the field is hidden initially based on depth. This is the blueprint:

tabs:
  main:
    display: Main
    sections:
      -
        display: General
      -
        display: Styling
        fields:
          -
            handle: render_as_button
            field:
              type: toggle
              display: 'Render as button'
              if:
                depth: '< 2'

@duncanmcclean
Copy link
Member

Thanks, I see it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants