Closed MoritzLost closed 1 month ago
What version of Navigation are you on? The level
attribute is certainly available for me
@engram-design Very curious 🤔 We're on the latest release 3.0.1, and Craft 5.2.1.
I've checked the source code, I can see the NodeCondition
class that's registering LevelConditionRule
and TypeConditionRule
, but neither of those are showing up in the interface. Any ideas?
Ah, I see there's an issue with it for Craft 5. Fixed for the next release. To get this early, run composer require verbb/navigation:"dev-craft-5 as 3.0.1"
.
@engram-design Works perfectly, thanks!
Fixed in 3.0.2
What are you trying to do?
I have some fields that I only want to display for root nodes (hierarchy level 1). In this case, the first level nodes are passives that each contain a mega menu structure. The mega menu includes some additional content (e.g. a headline, an image) that should be editable for the root nodes. However, all other hierarchy level should not show these fields, because they don't use them.
Nodes already support element condition rules, but there is no condition rule for the
level
property:What's your proposed solution?
Add a condition rule for the
level
where the field can be limited to only be visible for nodes at one or more specific levels. This would also address other use-cases. For example, in some situations it would be useful to only show a field for the second hierarchy level, or every level but the first one, etc.Additional context
Quick mockup (wording could be better):