-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Is it possible that adding customized attribute to sidebar item in order to group different item by this attribute? #3868
Comments
Hi, Currently, it's not possible to assign unknown attributes to the sidebar, because the shape of the sidebar items is validated quite aggressively to avoid typos. But we may allow this, as it's the 2nd time something similar is requested (#3787) Can you explain me better what you are trying to achieve exactly? You have swizzled the DocPage, and want to use additional custom attributes in your custom DocPage comp right? |
Would this work for your usecase? Putting custom attributes under "data" make sure we can still detect sidebars typos and validate the other attributes
cc @justinryder |
@slorber we also have a need for this on our project. We pass in all custom attributes within an object called |
Hi, @slorber, yes, I have swizzled DocPage, so I want to use additional custom attributes to judge something in my comp. About my usage situation, all sidebar menus separated into two categories: A(--> need to redirect to original DocPage), B(--> need to redirect to my customized DocPage), so for convenience I want to config one attributes to judge current item is A or B into sidebar item. so that I don't need to add extra config file to judge it. Thanks sincerely for your reply. |
Thanks @ReginaLiang @oriooctopus yes a PR is welcome for this thanks. |
Hi, @slorber, Thanks sincerely. |
Hi, probably later this week or early next week. |
💥 Proposal
such as:
sidebar item config is below:
and I can get this config in
DocPage
's props, then do something accordingisNeedMenu
.Is it possible?
Look forward to your reply.
Thanks.
version: 2.0.0-alpha.68
The text was updated successfully, but these errors were encountered: