@@ -103,6 +103,7 @@ export const getRouteData = ({
103
103
config,
104
104
importMap,
105
105
route : currentRoute ,
106
+ routeParams : { } ,
106
107
searchParams,
107
108
}
108
109
@@ -212,6 +213,8 @@ export const getRouteData = ({
212
213
`/${ segmentOne } ` === config . admin . routes . browseByFolder
213
214
) {
214
215
// --> /browse-by-folder/:folderID
216
+ initPageOptions . routeParams . folderID = folderID
217
+
215
218
ViewToRender = {
216
219
Component : oneSegmentViews . browseByFolder ,
217
220
}
@@ -221,6 +224,7 @@ export const getRouteData = ({
221
224
folderID = segmentTwo
222
225
} else if ( isCollection && matchedCollection ) {
223
226
// --> /collections/:collectionSlug
227
+ initPageOptions . routeParams . collection = matchedCollection . slug
224
228
225
229
ViewToRender = {
226
230
Component : ListView ,
@@ -234,6 +238,7 @@ export const getRouteData = ({
234
238
)
235
239
} else if ( isGlobal && matchedGlobal ) {
236
240
// --> /globals/:globalSlug
241
+ initPageOptions . routeParams . global = matchedGlobal . slug
237
242
238
243
ViewToRender = {
239
244
Component : DocumentView ,
@@ -256,6 +261,8 @@ export const getRouteData = ({
256
261
default :
257
262
if ( segmentTwo === 'verify' ) {
258
263
// --> /:collectionSlug/verify/:token
264
+ initPageOptions . routeParams . collection = segmentOne
265
+
259
266
ViewToRender = {
260
267
Component : Verify ,
261
268
}
@@ -264,10 +271,14 @@ export const getRouteData = ({
264
271
templateType = 'minimal'
265
272
viewType = 'verify'
266
273
} else if ( isCollection && matchedCollection ) {
274
+ initPageOptions . routeParams . collection = matchedCollection . slug
267
275
if ( config . folders && segmentThree === config . folders . slug && matchedCollection . folders ) {
268
276
// Collection Folder Views
269
277
// --> /collections/:collectionSlug/:folderCollectionSlug
270
278
// --> /collections/:collectionSlug/:folderCollectionSlug/:folderID
279
+ initPageOptions . routeParams . folderCollection = segmentThree
280
+ initPageOptions . routeParams . folderID = segmentFour
281
+
271
282
ViewToRender = {
272
283
Component : CollectionFolderView ,
273
284
}
@@ -283,6 +294,9 @@ export const getRouteData = ({
283
294
// --> /collections/:collectionSlug/:id/preview
284
295
// --> /collections/:collectionSlug/:id/versions
285
296
// --> /collections/:collectionSlug/:id/versions/:versionID
297
+ initPageOptions . routeParams . id = segmentThree
298
+ initPageOptions . routeParams . versionID = segmentFive
299
+
286
300
ViewToRender = {
287
301
Component : DocumentView ,
288
302
}
@@ -306,6 +320,8 @@ export const getRouteData = ({
306
320
// --> /globals/:globalSlug/preview
307
321
// --> /globals/:globalSlug/versions/:versionID
308
322
// --> /globals/:globalSlug/api
323
+ initPageOptions . routeParams . global = matchedGlobal . slug
324
+ initPageOptions . routeParams . versionID = segmentFour
309
325
310
326
ViewToRender = {
311
327
Component : DocumentView ,
0 commit comments