Giter Site home page Giter Site logo

Comments (8)

raagin avatar raagin commented on June 18, 2024

Hi! Use standard django admin functional.

If you use django-ckeditor just change models.TextField to RichTextField
(from ckeditor.fields import RichTextField) in your streamblocks/models.py
https://github.com/django-ckeditor/django-ckeditor#id6

Or you need to customize streamblocks/admin.py to add ckeditor widget

admin.site.unregister(RichText)
@admin.register(RichText)
class RichTextAdmin(StreamBlocksAdmin, admin.ModelAdmin):
     # here is your code for admin class of RichText. 

https://github.com/raagin/django-streamfield#custom-admin-class-for-blocks-models

from django-streamfield.

Deimos715 avatar Deimos715 commented on June 18, 2024

Hello, thank you. Do you now how to set
between text blocks?

from django-streamfield.

raagin avatar raagin commented on June 18, 2024

I think I misunderstood your question.

from django-streamfield.

Deimos715 avatar Deimos715 commented on June 18, 2024

Hello, I've added
into template and remove it by JS if block is last in queue. But it would be more comfortable to create a checkbox and give users an opportunity to set
if they need.
Also I found a bug: if you add two included blocks with pictures, then you can't remove them by "Remove" button. If there is one included block, "Remove" button works correctly. Can you fix this? Screenshot is attached.
3

from django-streamfield.

raagin avatar raagin commented on June 18, 2024

I fixed the bug. Try it in a new release (2.0.8). Thank you.
What checkbox do you mean?

from django-streamfield.

Deimos715 avatar Deimos715 commented on June 18, 2024

Hello, I've tested it on 2.0.8 with more than one picture block, removing works correctly now, thank you.
I mean checkbox for setting
between blocks of different types, here is the screenshot:
Снимок экрана от 2023-05-25 18-39-18

The content won't be divided visually without
.
You have similar margins parameter:

STREAMFIELD_BLOCK_OPTIONS = {
"margins": {
"label": "Margins",
"type": "checkbox",
"default": True
}
}

Is this possible to create similar checkbox for
for giving user right to decide necessity of the tag with its help?

from django-streamfield.

raagin avatar raagin commented on June 18, 2024

Do you want to make optional a tag <br> in your template?
You may use options as you wish. See here
https://github.com/raagin/django-streamfield#block-options

from django-streamfield.

Deimos715 avatar Deimos715 commented on June 18, 2024

Great, I'll try that, thank you very much.

from django-streamfield.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.