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

Fix support for snippets in the default backend skin #44

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

willouch
Copy link
Contributor

unhide snippets form area

Retrieve snippets in backend pages

unhide snippets form area
@LukeTowers
Copy link
Member

This would break the plugin when using TailwindUI, what is the underlying issue that's causing the problem?

@ericp-mrel
Copy link
Contributor

In the latest release it looks like the data-content-id attribute value was changed from snippet to snippets and that broke the snippets section and are no longer visible.

v2.1.2...v2.1.3#diff-4cac0956d5e7331650b7a41c11f104d7f902592225b5afadb3739fa5d4a86e3aR23

Screenshot 2024-05-29 at 8 26 46 AM

I can confirm this PR fixes the issue by updating the sidebar nav item link to match the most recent change that was made.

@LukeTowers
Copy link
Member

@ericp-mrel right, but it was changed from snippet to snippets because the exact same issue was occurring when using the Winter.TailwindUI plugin with this plugin except in reverse. Are you able to dig a bit further into what's causing the issue between the stock backend skin and the Tailwind UI skin that's causing it to break in one and work in the other?

@ericp-mrel
Copy link
Contributor

ericp-mrel commented Jun 3, 2024

It looks like problem is coming from the TailwindUI plugin where it's setting the data-menu-item attribute using a different value / source compared to the standard skin. It's setting the value of the data-menu-item from the sideMenu snippets array key rather than using the attributes array values.

Screenshot 2024-06-03 at 4 41 44 PM

Here's the default skin:

Here's where the standard skin is generating the attributes for the list item: https://github.com/wintercms/winter/blob/develop/modules/backend/layouts/_sidenav.php#L21

Screenshot 2024-06-03 at 4 49 44 PM

@LukeTowers
Copy link
Member

Thanks for digging into this issue that deeply @ericp-mrel, that was very helpful! And it shows that this PR actually fixes it for both the standard and the TailwindUI skin, so that's awesome too :)

We should probably still improve how the attribute is generated (I prefer the approach in the TailwindUI plugin where it's automatically generated instead of manually specified in the menu item definition), but that's an issue for another day.

@LukeTowers LukeTowers merged commit 56fd30b into wintercms:main Jun 7, 2024
@LukeTowers LukeTowers changed the title Update Plugin.php unhide snippets form area Fix support for snippets in the default backend skin Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants