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

Expose link dialog in a StreamBlock (LinkBlock) #3141

Closed
danni opened this issue Nov 6, 2016 · 6 comments
Closed

Expose link dialog in a StreamBlock (LinkBlock) #3141

danni opened this issue Nov 6, 2016 · 6 comments

Comments

@danni
Copy link
Contributor

danni commented Nov 6, 2016

There are times when you want a link that can either be internal or external like the rich text link dialog, but embedded in a stream. Currently you have PageChooserBlock and URLBlock but nothing that combines the two.

@mx-moth
Copy link
Contributor

mx-moth commented Nov 7, 2016

I agree, this would be very useful. I started working on PR #1645 that would make this a lot easier, by making the link chooser interface extensible and more generic. In that PR, the link chooser has tabs for pages, plain URLs, and emails like the current rich text editor, but also images and documents. Other apps could then register link choosers to appear in this modal. The modal would return a dict like {"type": "page", "pk": 3} or {"type": "url", "href": "http://example.com/"}, which could be passed to a function to generate a link.

Initially this was for the rich text editor, which is where that modal originates. Using it as a standalone widget would not be a huge amount of extra work once this PR was finished.

Sadly the PR stalled because of a lack of time, and because I was unsure how to continue. The document chooser is used in the rich text editor and the DocumentChooserWidget, for example. I never got around to coming up with an interface that worked across both environments in a way that was nice, and allowed future extensions to tie in easily.

If you are interested in collaborating on #1645 to finish it up, adding a LinkChooserWidget would then be simple.

@gasman gasman added this to the some-day milestone Nov 7, 2016
@rafaponieman
Copy link

+1 for this, it seems like its already implemented on RichTextField

@timorieber
Copy link
Contributor

Also requested in http://stackoverflow.com/questions/42673465/wagtail-extending-pagechooserblock-to-support-external-urls.

@chrisbarry
Copy link

I just used a streamblock to combine link & page (and could add document too) unless I'm missing something in the templating stage, doesn't this mean I can just build this feature like that? I admit having a single link dialog would be more robust, and should come out of the box.

@jimmywarting
Copy link

bump, status?

@gasman gasman removed this from the some-day milestone Mar 30, 2022
@thibaudcolas
Copy link
Member

I believe this is a duplicate of #381? There is StreamField discussion on there, and even if this existed outside StreamField, I presume it would be simple to use within a block as well. Will close on that basis – if I got this wrong please let me know and we’ll reopen.

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

8 participants