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

Body content as StreamField #40

Closed
iampbernardo opened this issue Mar 20, 2016 · 31 comments
Closed

Body content as StreamField #40

iampbernardo opened this issue Mar 20, 2016 · 31 comments
Assignees
Milestone

Comments

@iampbernardo
Copy link

Maybe the WordPress way is not the best way, but I think some of the WordPress options to create diferent kind of posts is a very good idea.

Something like
custom_post_types

What do you think about that. Is it too opinionated aproach?.
Should those be pluggins?

@marctc
Copy link
Collaborator

marctc commented Mar 20, 2016

I'm working on a similar approach. We use Puput in APSL's blog but we have the problem that the default RichTextField don't work well for other things like inserting code snippets. We though an interesting approach would be replace the body field from a RichTextField to a StreamField (see this link http://thirdworldnomad.com/2015/06/22/developing-wagtail on the section "Extending StreamField Block").

@iampbernardo
Copy link
Author

Looks like a great aproach.
Then this library could also help with syntax highlighting http://prismjs.com/

The main problem would be migrating already exiting posts, right?

@marctc marctc added this to the 1.0 milestone Mar 20, 2016
@marctc
Copy link
Collaborator

marctc commented Mar 20, 2016

Yes, it is. For the moment, I think that the best option is have two body fields and provide to user a tool to migrate between fields (something like this http://docs.wagtail.io/en/v1.4.1/topics/streamfield.html?highlight=streamfield#migrating-richtextfields-to-streamfield=

@marctc marctc self-assigned this Mar 21, 2016
@marctc marctc changed the title Custom post types Body content as StreamField Mar 21, 2016
@mronoffon
Copy link

what is the status of the 'RichTextField to a StreamField' (if there is one)?

@marctc
Copy link
Collaborator

marctc commented Sep 2, 2016

Hi @mronoffon,
I've waiting if wagtail-markdown make any progress to be production ready.

There are a branch for this goal. Feel free to try it.

@FlipperPA
Copy link
Contributor

Howdy @marctc, thanks for your efforts! I have a pretty good generic StreamField body block I've developed. Want me to implement a version and issue a PR? Perhaps as a different Entry page type, maybe a "StreamEntry"?

@mronoffon
Copy link

mronoffon commented Nov 26, 2016 via email

@marctc
Copy link
Collaborator

marctc commented Nov 26, 2016

Howdy @marctc, thanks for your efforts! I have a pretty good generic StreamField body block I've developed. Want me to implement a version and issue a PR?

Yeah, sounds good to me. What do you have in mind?

Perhaps as a different Entry page type, maybe a "StreamEntry"?

I would rather implement as an extra body field in Entry model and set the body field as blank=True

@mronoffon
Copy link

any headway?

@marctc
Copy link
Collaborator

marctc commented Jan 27, 2017

We are working on it in this PR: #83

@FlipperPA
Copy link
Contributor

Feel free to help out with the PR if anyone would like! I'm hoping to get some time soon to merge the best from both branches.

@MiltonLn
Copy link
Collaborator

Please see pull request #112

@albcunha
Copy link

Guys, I made a symbolic bountysource for this feature. Not a lot, 50 bucks, but better than nothing, right? Keep up the good work!

@marctc
Copy link
Collaborator

marctc commented Aug 21, 2017

Awesome!!! Thank you very much @albcunha. Never heard about this. @MiltonLn @FlipperPA can you take a look?

@sabueso
Copy link

sabueso commented Aug 21, 2017

@albcunha is there some possibility to increase those 50 bucks with money from other users? I'll be happy to contribute ;)

@marctc
Copy link
Collaborator

marctc commented Aug 21, 2017

@sabueso
Copy link

sabueso commented Aug 21, 2017

@marctc Done!

@marctc
Copy link
Collaborator

marctc commented Aug 21, 2017

awesome!

@marctc
Copy link
Collaborator

marctc commented Mar 5, 2018

@albcunha @sabueso it seems that with new wagtail editor this issue won't need to develop. We appreciate your economical effort, but maybe it will fair if nobody earns that money. What do you think?

@FlipperPA
Copy link
Contributor

What still needs doing here? I thought it was mostly complete, but its honestly been quite a while now and would probably need some tweaks for Wagtail 2.0. :)

@MiltonLn
Copy link
Collaborator

MiltonLn commented Mar 6, 2018

@FlipperPA, we are just going to support wagtail 2.0 to use draftail, that would solve all of our needs, I'm taking care of that this week

@albcunha
Copy link

albcunha commented Mar 6, 2018

I think my share can be donated to you. After all, you deserve free beer on the house!

@FlipperPA
Copy link
Contributor

FlipperPA commented Mar 6, 2018

@MiltonLn Right on, good to hear! I'm sticking with the structured content approach of StreamField with Peregrine, so that'll be a nice differentiation. If y'all can make it to DjangoCon US this Fall in San Diego, I'd love to chat Wagtail blog software!

@marctc
Copy link
Collaborator

marctc commented Mar 6, 2018

@FlipperPA can you show us a screenshot of how it looks?

@FlipperPA
Copy link
Contributor

Sure! Here's the site: https://PyPhilly.org/ The ABOUT page has an image header example. It's running entirely Wagtail 2 on Django 2. The backend is using Zappa to run on AWS Lambda serverless with SQLite on S3. Total cost: $0.56 to host last month! :)

And here's the editor:

peregrine-page-editor

@marctc
Copy link
Collaborator

marctc commented Mar 11, 2018

@albcunha @sabueso do you think that the options that draftail provide by default (https://springload.github.io/draftail/) is enough or we need something special?

@albcunha
Copy link

I agrree with Milton regarding highlighted code. The alternative given by Flipper Works great as well. But there's a dealbreaker for me. Sometimes I embed iframes. Would it be difficult to allow it to edit the HTML source code?

1 similar comment
@albcunha
Copy link

I agrree with Milton regarding highlighted code. The alternative given by Flipper Works great as well. But there's a dealbreaker for me. Sometimes I embed iframes. Would it be difficult to allow it to edit the HTML source code?

@FlipperPA
Copy link
Contributor

That's a tricky one, especially with Draftail as there is not HTML stored in the database. It stored the whole editor area as JSON, which is rendered to HTML on demand. It might be necessary to create some sort of IFRAME or RAW HTML button for those cases, that just renders whatever you put into the field exactly as it appears.

@MiltonLn
Copy link
Collaborator

I agree with @FlipperPA, Is also worth saying that kind of feature is away the scope of this project, maybe that can be better handled directly on Wagtail project.

@MiltonLn
Copy link
Collaborator

Closing this because we are now supporting Wagtail 2.0 and its cool Draftail editor, please reopen if something different is needed.

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

7 participants