django-cms / djangocms-bootstrap4

django CMS Bootstrap 4 is a plugin bundle for django CMS providing several components from the popular Bootstrap 4 framework.
https://www.django-cms.org/
Other
82 stars 58 forks source link

carousel image default size not changeabel #70

Closed didierCH closed 5 years ago

didierCH commented 5 years ago

I need to set the image settings for the carousel to be changed, so that the images doesn't get downsized to 1024 width. I created a template with the following content:

{% with 1440 as width %}

grafik

But the image always get downscaled to 1024 x 768px.

I also tried to set the settings configuration to:

DJANGOCMS_BOOTSTRAP4_CAROUSEL_DEFAULT_SIZE = [1440, 593] from here https://github.com/wanaryytel/djangocms-bootstrap4/blob/2c1f05008f0825348e4540f9bf06722b29c09ea6/README.rst

but didn't worked.

What can I do?

goutnet commented 5 years ago

same issue here…

FinalAngel commented 5 years ago

DJANGOCMS_BOOTSTRAP4_CAROUSEL_DEFAULT_SIZE is actually not used. If nothing is defined or found it fallbacks to: https://github.com/divio/djangocms-bootstrap4/blob/master/djangocms_bootstrap4/contrib/bootstrap4_carousel/constants.py#L30 We'll have a fix ready for the next release.

However, you also need to remove the default width definition in: https://github.com/divio/djangocms-bootstrap4/blob/master/djangocms_bootstrap4/contrib/bootstrap4_carousel/templates/djangocms_bootstrap4/carousel/default/carousel.html#L22

If you set the with template tag correctly around the instance the CAROUSEL_DEFAULT_SIZE fallback will be ignored.

didierCH commented 5 years ago

It works now. Thank you very much! To overwrite the default settings, you have to put your new template in the following place: mysite/templates/djangocms_bootstrap4/carousel/default/carousel.html