how to add parent attribute to resource

i tried to add a parent to my resource but there is no parent attributes
K
kapa.ai335d ago
Hi @saji_nael. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To add a parent to your resource, you can use the meta.parent property in the resource object. Here's an example of how to do this:
<Refine
...
resources={[
{
name: "parent",
},
{
name: "child",
meta: {
parent: "parent",
},
},
]}
/>
<Refine
...
resources={[
{
name: "parent",
},
{
name: "child",
meta: {
parent: "parent",
},
},
]}
/>
In this example, the child resource is nested under the parent resource. Make sure the meta.parent value matches the name of the parent resource you want to nest under. For more information on multi-level menus and nesting resources, you can refer to this documentation (https://refine.dev/docs/advanced-tutorials/multi-level-menu). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
K
kapa.ai335d ago
<@1000087684632547538> kapa.ai is still learning and improving, please let us how it did by reacting below
E
extended-salmon335d ago
i tried to add this meta: { parent: "parent", }, and I got a compiler error @kapa.ai
K
kapa.ai335d ago
Let me check the knowledge base for you. One moment! :books: Sorry @saji_nael, I seem to be having a bit of trouble. Don't worry though, I've pinged my supprt and they will try to fix me up! :technologist: Perhaps try again in 15mins?
C
conscious-sapphire335d ago
Hey @saji_nael, in the resources property; you can do as follows:
<Refine
resources={[
{
name: "posts",
meta: { parent: "CMS" },
}
]}
>
/* ... */
</Refine>
<Refine
resources={[
{
name: "posts",
meta: { parent: "CMS" },
}
]}
>
/* ... */
</Refine>
Even if there's no CMS resource, it will be accepted as parent and menu will be rendered accordingly. If this gives you errors, can you please share the error? We can try to find a solution to it.
E
extended-salmon334d ago
No description
E
extended-salmon334d ago
here is my code it is not working i got compile error for meta Type '{ name: string; create: FC<{}>; edit: FC<any>; show: FC<any>; list: FC<{}>; canDelete: true; meta: { parent: string; }; }' is not assignable to type 'ResourceProps'. Object literal may only specify known properties, and 'meta' does not exist in type 'ResourceProps'
C
conscious-sapphire334d ago
Looks like you are using v3, you can do { name: "posts", parentName: "parent" }
E
extended-salmon334d ago
thank you
More Posts
redirect issueas soon as the page loads on the screen it should be redirected to the login page. I have made the llooking for nextjs landingpage + non-public area sampleHello everyone! 👋 I'm currently working on a project and was wondering if anyone has or knows of srefine x supabase: file upload issueHi, I'm trying to add a video upload section in my project, but I keep getting the error in the attaloginI have the Google Auth. I want to add the login using email and password and have implimented the foAuth ProviderWhen i am trying to vist autenticated page, it is checkAuth method to check is the user is authorizeclient side filter with filters.mode=off not workingHello refine community, filters.mode=off works as expected if I used column header filters. But ifbroken link to documentationSeems to be broken https://refine.dev/docs/ui-frameworks/antd/components/authpage/How do I pass invitation token with google auth to my backend?import { CredentialResponse } from "../interfaces/google"; export const Login: React.FC = () => { Using useRegister example, throws a type error.I'm using the example provided that's listed under pages/customRegisterPage: https://refine.dev/docsDeploying to DO app platform with FetchHello, So I have a fetch script on one of my edit pages that when the page loads it sends the ID ofIs that possible to implement more than one auth provider?Is that possible to implement more than one auth provider? At the moment i have only google authentiMigrating from existing projectGreetings! I was wondering how easy it is to go from a vanilla react project to use Refine. We haveuseLoginI'm looking for a headless example of using useLogin. Ideally I want to have a custom login page setHow to use form instance ANTD inside filterDropdown?https://codesandbox.io/s/compassionate-bash-pzxuf7?file=/src/App.jsx Please help me build a correctChange resource primary keyIs there a way to change a resource's primary key property? For example I have a resource which its Selected value is lost in Mantine Select if a search is done after selecting a valueWhen using the selectProps from the useSelect hook, and creating a Mantine Select component with thoRecruitement managementis there a way i can create an application of recruitement management like this im stuck findingnextjs project wont show after i install NPM packageI created a Nextjs, Materiual-UI, Supabase/Supabase project,,, I installed Styled-Compomnents And Inferencer fails to generate `Show` and `Edit` components with headless refineI wonder if it is just me or someone else is seeing it too. The refine.new generated project displayuseTable. Passing Id to data provider?Hello, My requirements need that my application renders a table("parent" table), and each table r