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

Add Block: Bookmark/HTML Anchor #1734

Closed
jasmussen opened this issue Jul 5, 2017 · 8 comments
Closed

Add Block: Bookmark/HTML Anchor #1734

jasmussen opened this issue Jul 5, 2017 · 8 comments
Assignees
Labels
[Feature] Blocks Overall functionality of blocks
Milestone

Comments

@jasmussen
Copy link
Contributor

This could either be a separate block, as this ticket suggests, or a part of #887. The purpose would be to let you create an HTML anchor — a bookmark down the page, so you could link to a specific section.

What would it look like? Would it be somehwat like #983? Would it be visible on the front-end, like perhaps a small hash mark in the side? It seems worth looking at how WYSIWYG HTML editors like Dreamweaver has done this in the past.

@jasmussen jasmussen added [Feature] Blocks Overall functionality of blocks Design labels Jul 5, 2017
@jasmussen jasmussen modified the milestones: Beta, Nice To Have, Beta 0.8.0 Jul 5, 2017
@mtias mtias modified the milestones: Beta 0.5.0, Beta 0.8.0, Beta 0.7.0 Jul 6, 2017
@mtias
Copy link
Member

mtias commented Jul 8, 2017

I've been thinking a bit about this one and I believe we should add it as an optional (maybe advanced) setting to all blocks. It could look like "add anchor id" or "link directly to this block" with an explanation of how it works. We could check that the id is unique. It'd be nice if this setting could live at the bottom of the inspector, somehow. Maybe together with a trash this block? It shouldn't get in the way.

@jasmussen
Copy link
Contributor Author

I've been thinking a bit about this one and I believe we should add it as an optional (maybe advanced) setting to all blocks.

+1+1 that sounds like a great approach, and good use of the advanced block interface.

@karmatosed karmatosed added Needs Design Needs design efforts. and removed Needs Design Needs design efforts. labels Jul 10, 2017
@karmatosed
Copy link
Member

I would also +1 to this being an advanced setting over a new block.

@mtias
Copy link
Member

mtias commented Aug 4, 2017

Punting.

@mtias mtias modified the milestones: Beta 0.8.0, Beta 0.7.0 Aug 4, 2017
@youknowriad
Copy link
Contributor

Some technical thoughts about this:

An advanced option for all blocks: Does this mean we create a wrapper for all blocks? It would have a big impact on parsing.
Can't we just add it as an option for the heading block?
Uniqueness check: This means a block can access the global state (post content) to check for uniqueness, it's not possible for now because we have this separation: the blocks are defined in the blocks module and all what they need is provided using props (+ editor settings) and the global state is in the editor module.

@breath-ee
Copy link

Feature request for html anchor on image blocks. Or better still added to all blocks!

@kalnode
Copy link

kalnode commented Sep 1, 2018

FYI, Header blocks already have an anchor field (inside 'Advanced'); it works. In actuality, all it does is apply a custom ID to the Header block, which you can link to as an anchor. This is according to HTML5 spec.

Technically all Gutenblocks could have a custom ID, useful for all kinds of things, not just anchors.

As for an actual Anchor block, personally I would find it useful because I like to place hidden anchors higher up on a page so that when the user clicks an anchor link, the anchor content starts 1/3 down the screen rather than the top edge --- a more pleasant experience. This is done with something like <div id="my_anchor" style="visibility:hidden"></div>. In this case, an Anchor block would be convenient and less annoying than seeing HTML code blocks in the middle of my editor view.

@shabikaplan
Copy link

shabikaplan commented Mar 27, 2019

FYI, Header blocks already have an anchor field (inside 'Advanced'); it works. In actuality, all it does is apply a custom ID to the Header block, which you can link to as an anchor. This is according to HTML5 spec.

Technically all Gutenblocks could have a custom ID, useful for all kinds of things, not just anchors.

As for an actual Anchor block, personally I would find it useful because I like to place hidden anchors higher up on a page so that when the user clicks an anchor link, the anchor content starts 1/3 down the screen rather than the top edge --- a more pleasant experience. This is done with something like <div id="my_anchor" style="visibility:hidden"></div>. In this case, an Anchor block would be convenient and less annoying than seeing HTML code blocks in the middle of my editor view.

This is true, but we should have an option to hide the heading also, so that the user can create an anchor without having to display a heading block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks
Projects
None yet
Development

No branches or pull requests

7 participants