Model a page to access from 1 or 2 paths

What would be the recommended model where I can use one custom type to create pages for /parent-path/slug or just /parent-path? eg /about, /community/about, /resources/tips

I could have created custom type for each parent-path and use UID for slug - but if all my pages going to use the same slices why do I trouble myself duplicate the same custom type?

I was thinking to just use Key Text field for Parent Path or even using tags as explained here linkResolver and nested paths - but there is a limitation with UID where it is only unique within a custom type which means I can't share one custom type for all pages.

Hello Rizky,

Thank you for reaching out to us.

If I understand your question correctly, you have asked for 2 topics:

  1. Content modeling, why only 1 custom type is not sufficient to create all pages.
  2. You want to use the same uid for multiple pages such as “aboutus” uid for /aboutus and /community/aboutus

Here are my answers:

  1. The main idea behind defining multiple custom types for a site is to share the same structure and slices between the common types of pages. For example: if there is a blog site, you can have the same Blog custom type for all blogs, but for other pages such as blog listing or contacts, they will have different Custom Types.
  2. The same UID's are not allowed to instances made from the same custom types, but of course, you can give the same UID's concerning different custom types.

Let me know If you have any doubts.

Thanks,
Priyanka

Thanks @Priyanka , would using Route Resolver from Slice Machine be possible so that I can use linked documents to get its parent-path?

I did not use Next it's just react for now, is it worth it to enable SM on my repo for this purpose? Any concerns I need to be aware of?

Hey Rizky,

Can you please share your Prismic repo URL to activate SM?

Thanks,
Priyanka

Hello @rizky

I apologize for the inappropriate response from my side. Yes, It is possible to use Route Resolver from the Slice Machine to get its parent path. The only issue is that the Slice Machine is available only for Next.js and Nuxt.js frameworks. It doesn't come with React.js.

I can enable the Slice Machine to your repo if you are using any of those frameworks.

Thanks,
Priyanka

Threads close after a period of inactivity. Flag this thread to re-open it and continue the conversation.