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

docs: update readme file #131

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,27 @@ This will generate a class prefixed with ``align-``. The example above
would produce a ``class="align-top"``. Adding a ``class`` key to the image
attributes automatically merges the alignment with the attribute class.

As per the choice use multiple alignment style options with ``DJANGOCMS_PICTURE_ALIGN``, for example::
must have to align image with multiple styles such as left, right or center as well as float image and verticle align image.

DJANGOCMS_PICTURE_ALIGN = [
('left', _('Align left')),
('right', _('Align right')),
('center', _('Align center')),
#image-float align option
("start", _("Float left")),
("end", _("Float right")),
#verticle-align option
('top', _('Align top')),
('middle', _('Align middle')),
('bottom', _('Align Bottom')),
('baseline', _('Align baseline')),
]

This will generate a class prefixed with ``align-``. For left align option the above example would produce a ``class="align-left"``. Adding a ``class`` key to the image attributes automatically merges the alignment with the attribute class.
It works same for others align options.
For this refer https://getbootstrap.com/docs/5.2/content/images/#aligning-images for css styles.

Comment on lines +100 to +120
Copy link
Sponsor Member

@fsbraun fsbraun Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
As per the choice use multiple alignment style options with ``DJANGOCMS_PICTURE_ALIGN``, for example::
must have to align image with multiple styles such as left, right or center as well as float image and verticle align image.
DJANGOCMS_PICTURE_ALIGN = [
('left', _('Align left')),
('right', _('Align right')),
('center', _('Align center')),
#image-float align option
("start", _("Float left")),
("end", _("Float right")),
#verticle-align option
('top', _('Align top')),
('middle', _('Align middle')),
('bottom', _('Align Bottom')),
('baseline', _('Align baseline')),
]
This will generate a class prefixed with ``align-``. For left align option the above example would produce a ``class="align-left"``. Adding a ``class`` key to the image attributes automatically merges the alignment with the attribute class.
It works same for others align options.
For this refer https://getbootstrap.com/docs/5.2/content/images/#aligning-images for css styles.
When using the `DJANGOCMS_PICTURE_ALIGN` setting, you have the flexibility to align images in various styles, such as left, right, or center, as well as to float images and vertically align them. You can customize these alignment options as follows::
DJANGOCMS_PICTURE_ALIGN = [
('left', _('Align left')),
('right', _('Align right')),
('center', _('Align center')),
# Image float alignment options
("start", _("Float left")),
("end", _("Float right")),
# Vertical alignment options
('top', _('Align top')),
('middle', _('Align middle')),
('bottom', _('Align Bottom')),
('baseline', _('Align baseline')),
]
This configuration will generate a CSS class prefixed with ``align-``. For example, when selecting the left align option, it will produce a class attribute like ``class="align-left"`` for the image. You can apply these classes to your image attributes, and they will automatically handle the alignment.
These alignment options are consistent with `Bootstrap's image alignment styles <https://getbootstrap.com/docs/5.3/content/images/#aligning-images>`_, however, **you have to provide your own CSS styles for the alignment options**, be it through Bootstrap or otherwise.

You can enable responsive images technique by setting``DJANGOCMS_PICTURE_RESPONSIVE_IMAGES`` to ``True``.
In this case uploaded images will create thumbnails of different sizes according
to ``DJANGOCMS_PICTURE_RESPONSIVE_IMAGES_VIEWPORT_BREAKPOINTS`` (which defaults to ``[576, 768, 992]``) and browser
Expand Down
Loading