Good morning (at least for me, it's morning) @solution.stack99 ,
The setup I'm explaining is not a rabbit hole I've enjoyed. Of all my projects, it's the only one using this catch-all page. It was necessary because this client was migrated from WordPress, and I didn't want to do many redirects. So, whenever possible, I try to avoid this setup.
If you're looking to recreate it because you "have to" as well, then allow me to suggest this:
Custom Type: Subdirectory
"id": "subdirectory",
"label": "Sub-Directory",
"repeatable": true,
"status": true,
"json": {
"Main": {
"title": {
"type": "Text",
"config": {
"label": "Title",
"placeholder": ""
}
},
"uid": {
"type": "UID",
"config": {
"label": "UID",
"placeholder": ""
}
}
}
}
}
Page Type: Page
just note the subdirectory relationship
{
"id": "page",
"label": "Page",
"repeatable": true,
"status": true,
"format": "page",
"json": {
"Main": {
"title": {
"type": "StructuredText",
"config": {
"label": "Title",
"placeholder": "Enter the page title",
"allowTargetBlank": true,
"single": "heading2"
}
},
"hidepagetitle": {
"type": "Boolean",
"config": {
"label": "Hide Page Title",
"placeholder_false": "false",
"placeholder_true": "true",
"default_value": false
}
},
"uid": {
"type": "UID",
"config": {
"label": "UID",
"placeholder": "This will be in the address bar"
}
},
"metadescription": {
"type": "Text",
"config": {
"label": "MetaDescription",
"placeholder": "Describe the page's purpose for SEO"
}
},
"metaimage": {
"type": "Image",
"config": {
"label": "MetaImage",
"constraint": {},
"thumbnails": []
}
},
"twitterimage": {
"type": "Image",
"config": {
"label": "TwitterImage",
"constraint": {},
"thumbnails": []
}
},
"canonicalurl": {
"type": "Text",
"config": {
"label": "CanonicalUrl",
"placeholder": "Leave empty unless needed"
}
},
"subdirectory": {
"type": "Link",
"config": {
"label": "Subdirectory",
"select": "document",
"customtypes": ["subdirectory"]
}
},
"datepublished": {
"type": "Date",
"config": {
"label": "DatePublished",
"placeholder": "Optionally set published date"
}
},
"slices": {
"type": "Slices",
"fieldset": "Slice Zone",
"config": {
"choices": {
"content": {
"type": "SharedSlice"
},
"features": {
"type": "SharedSlice"
},
"hero": {
"type": "SharedSlice"
},
"list": {
"type": "SharedSlice"
},
"recipe_card": {
"type": "SharedSlice"
},
"board_members": {
"type": "SharedSlice"
},
"form": {
"type": "SharedSlice"
},
"two_grid": {
"type": "SharedSlice"
},
"image_container": {
"type": "SharedSlice"
},
"disclosure": {
"type": "SharedSlice"
},
"policy_and_advocacy": {
"type": "SharedSlice"
},
"courses_stuff": {
"type": "SharedSlice"
},
"timeline": {
"type": "SharedSlice"
},
"featured_news": {
"type": "SharedSlice"
}
}
}
}
}
}
}
Route Resolver
as shown in previous reply
const routes: prismic.ClientConfig['routes'] = [
{
type: 'homepage',
path: '/',
},
{
type: 'page',
path: '/:subdirectory?/:uid',
resolvers: {
subdirectory: 'subdirectory',
},
},
]
I hope this helps some.