e.g say i have a products folder that has sub-folders for each category. Each category folder has a start-page for that category and multiple product pages inside as per layout below
products folder > category folder > category page product page product page product page category folder > category page product page product page product page
let’s say i want to get all category stories for a “All products” page, you can fetch from cdn/stories?starts_with=products?is_startpage=1/ However, the order will not match the category folder structure as instead it will order off the current position which is based on the position of the category page within it’s own folder. so some of category stories will have the exact same position, 0, and they will not match the folder positions.
Options to get around this are as follows:
fetch links for the products folder, filter out the start-pages and then use the uuid’s to fetch each story by uuid_order.
make separate category and products main folders and link to one from the other. This means the category pages will order per position under the one folder. This itself can be a pain because the side effect will be all products within one folder can get out of control to filter through. Yes, you can make sub-folders inside to separate products into categories, however you can quickly run into issues with dynamic routing on the front-end. e.g a category page url would be ‘products/:category’ and a products page would ideally be ‘products/:category/:product’ so if you were to split the products into separate folders the slug would have to exactly match that of a category due to the :full-slug being used to get one story.
*multiple different field type implementations could make something work, yet can be hard to keep track of and may need to be used in different places which will be repetition e.g the navigation menu, and the all products page.
I don’t know if I’ve missed something , but i feel like this would be a useful implementation for ordering based on the position of items in the content folder.
Feel free to let me know if there is a better way around this?