xiaohutai / bolt-hierarchicalroutes

[Bolt Extension] Hierarchical content using `menu.yml` for Bolt CMS
https://market.bolt.cm/view/twokings/hierarchical-routes
MIT License
7 stars 3 forks source link

[Feature] Handle duplicate entries better #10

Open xiaohutai opened 7 years ago

xiaohutai commented 7 years ago

Very early and rough version and most likely for v2.0.0.

Introduction

There's a complexity to this issue:

Which one is the canonical link? This would still be something similar to the overwrite-duplicates setting. This will in essence be something like: which canonical would you prefer.

Then duplicates need to be added, but checking for parents and children will then depend on which variant you are of the page.


Case 1: same level siblings should be merged.

├─ page 1
└─ page 1

Only makes sense if we allow different slugs (aliases) for these.

Case 2: parent-child relationship

└─ page 1
   └─ page 1

Different slugs, so both locations need to exist. Need to keep track of which alias we are on.

Case 3: somewhere else

├─ page 1
└─ page 2
   └─ page 1

Basically the same as Case 2.


Conclusion

An intermediate lookup table is required and every lookup key is based on an alias. Also an additional lookup table for canonicals need to be added. Generation of breadcrumbs may differ depending on which tree branch we are on.

For generating URLs: We might need to look at the current stucture in order to determine what the link should be. Maybe this issue is completely impossible because of that context-sensitivity.

xiaohutai commented 7 years ago

Basically every duplicate item, needs to be an alias. I believe in MODX, this was called a symlink.