Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Update Navigation block in templates to use layout attributes #230

Closed
tellthemachines opened this issue Nov 12, 2021 · 3 comments · Fixed by #260
Closed

Update Navigation block in templates to use layout attributes #230

tellthemachines opened this issue Nov 12, 2021 · 3 comments · Fixed by #260
Milestone

Comments

@tellthemachines
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

The Navigation block was updated in WordPress/gutenberg#36169 to use the new layout controls, such as Query loop, Row, Buttons and Social Icons blocks also use. This means that the attribute structure in Navigation block markup has changed slightly, so it would be good to update the Navigation blocks in Twenty Twenty Two templates accordingly.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Currently we have e.g.: <!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> . With layout, this should change to <!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} /-->. (is-responsive is now on by default so it's no longer necessary to specify it.)

Nothing should break if using the old attributes, because there is a deprecation in place to handle them, but as this is the default theme shipping with 5.9 it would be nice to use the latest markup 🙂

@kjellr kjellr added this to the Beta 2 milestone Nov 12, 2021
@kjellr
Copy link
Collaborator

kjellr commented Nov 19, 2021

I tried giving this a go, but swapping out with the markup above (and a few other variations I tried) all threw markup errors:

Screen Shot 2021-11-19 at 11 11 48 AM

Is that still the markup we should be using?

@tellthemachines
Copy link
Author

Oh, I see the issue. Sorry, there's a typo in my snippet; it shouldn't have the closing slash because the navigation block in the template has a closing tag already 🤦

This should work:

<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right"}} -->

@kjellr
Copy link
Collaborator

kjellr commented Nov 22, 2021

Thanks @tellthemachines! I have a PR here: #260

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

Successfully merging a pull request may close this issue.

2 participants