-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
Use position for element dom_id #2368
Conversation
33d3319
to
a62d4af
Compare
923bef1
to
bfcd895
Compare
bdd0fe5
to
ea72966
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's with the position of nested elements? Could there be conflicts?
Yes, if the same element is also nested into another element. We could add the parents Also, I thought ultimately we could add a |
ea72966
to
5a7287e
Compare
We cannot use the id, because that will change if publish the page. The position will be the same across versions and combined with the name it is unique on each page. Fixes AlchemyCMS#2354
Use `element.dom_id` instead.
Please implement your own unique DOM ID for your elements and pass it as anchor to your URLs.
5a7287e
to
acaf339
Compare
@tvdeyen this breaks links using anchors, right? |
@dbwinger no, it makes them work again. It stopped working after we introduced page versions and didn't realized that the database ID used as DOM ID does not work anymore. Existing links have been broken since then and this fixes the issue for new links created. This behavior is now configurable and can be adjusted to your liking as well. Hopefully this works for you |
Got it. Yes, this will work. I think I can easily migrate my broken links. |
What is this pull request for?
Change the DOM ID of elements to use position instead of id
We cannot use the id, because that will change if publish the page. The position will be the same across versions and combined with the name it is unique on each page.
Deprecate
element_dom_id
helperUse
element.dom_id
instead.Deprecate
full_url_for_element
helperPlease
element.dom_id
and pass it as anchor to your URLs.Refs #2354
Checklist