Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Handle duplicate entries better #10

Open
xiaohutai opened this issue May 19, 2017 · 1 comment
Open

[Feature] Handle duplicate entries better #10

xiaohutai opened this issue May 19, 2017 · 1 comment
Assignees
Milestone

Comments

@xiaohutai
Copy link
Owner

xiaohutai commented May 19, 2017

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

  • slugs of duplicate items need to be different:
  • a list of aliases need to be added so we can map aliases to the record

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.

  • aliases[ alias => record ] -> new
  • canonicals[ record => alias ] -> new
  • children[ alias => array of children ]
  • parents[ alias => parent ]
  • slug[ alias => slug ]

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 xiaohutai modified the milestone: v2.0.0 May 19, 2017
@xiaohutai xiaohutai changed the title [Feature] Handle duplicate entries _better_ (if possible) [Feature] Handle duplicate entries better May 19, 2017
@xiaohutai
Copy link
Owner Author

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

@xiaohutai xiaohutai self-assigned this Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant