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

Cannot link to another blocks anchors #796

Closed
2 tasks
StephenMakrogianni opened this issue May 11, 2020 · 5 comments
Closed
2 tasks

Cannot link to another blocks anchors #796

StephenMakrogianni opened this issue May 11, 2020 · 5 comments

Comments

@StephenMakrogianni
Copy link
Contributor

StephenMakrogianni commented May 11, 2020

Issue:

In the WYSIWYG editor, content authors cannot link to another blocks anchors.

Proposed solution

  • Create a hook or move existing hook on SiteTree::getAnchorsOnPage() and update the list with the selected page's anchors categorized by the Elemental block they are in.

  • Change how the list is displayed to something similar to the tree drop down field where the content author could select the Elemental block to anchor to or one of it's "children" (anchors in the WYSIWYG).

Note:
I have started working on the solution and am taking the following into consideration:

  • Multiple EementalArea on a single page
  • Multiple HTMLText fields on an Element
  • Making this an optional configuration
  • A setting to make the Element undiscoverable
  • An optional name to be used as the id of the Element. Will fallback to the Title or generate UID if Title is unset
  • Ensure anchor link doesn't display as broken in WYSIWYG.

Anything else put it in a comment.

Related

#894

PRs

@mfendeksilverstripe
Copy link
Contributor

I suggest to use getUniqueKey() to generate the anchor IDs.

@StephenMakrogianni
Copy link
Contributor Author

Nice one @mfendeksilverstripe 👍 will do.

@brynwhyman
Copy link

Hey @StephenMakrogianni how have you been getting on with a solution here?

@StephenMakrogianni
Copy link
Contributor Author

@brynwhyman haven't had a chance to get to it yet mate. Hack day is coming up though so might give it a nudge then

@GuySartorelli
Copy link
Member

The root problem here is that anchors inside an elemental block are not properly supported. This will be resolved with #186, so I'm closing this issue in favour of that one.

@GuySartorelli GuySartorelli removed their assignment May 25, 2022
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

5 participants