helpful-purple
helpful-purple14mo ago

additional slug in getOne

How to custom more in show page like show: '/socialnetworks/show/:something/:id',
2 Replies
kapa.ai
kapa.ai14mo ago
Hi @tads8799. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- In Refine, you can customize the show action path for a resource by defining it in the resources configuration of the <Refine> component. You can add additional parameters to the path, such as :something in your case. Here's an example:
resources={[
{
name: "socialnetworks",
list: SocialNetworksList,
show: "/socialnetworks/show/:something/:id",
create: CreateSocialNetwork,
edit: EditSocialNetwork,
icon: <Build />,
},
]}
resources={[
{
name: "socialnetworks",
list: SocialNetworksList,
show: "/socialnetworks/show/:something/:id",
create: CreateSocialNetwork,
edit: EditSocialNetwork,
icon: <Build />,
},
]}
In this configuration, the show action path for the socialnetworks resource is defined as /socialnetworks/show/:something/:id. The :something and :id are placeholders for specific values that you can use in your component. When you navigate to the show page of a resource, you can pass these parameters to the navigation function. The existing parameters from the URL and the meta property of these functions will be used to determine the additional parameters when composing the path. Remember, your action definitions in the resources can contain additional parameters and nested routes. Passing these parameters when navigating to the pages are handled by the current available parameters and the meta props of the related hooks and components. For more information, refer to the resources section of the <Refine> component documentation (https://refine.dev/docs/api-reference/core/components/refine-config/) and the support thread on Discord (https://discord.com/channels/837692625737613362/1125437830701776967). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai14mo ago
<@577213996344803338> kapa.ai is still learning and improving, please let us know how it did by reacting below

Did you find this page helpful?