Closed greyhare closed 1 year ago
Also, why are arbitrary contained plugins allowed (i.e. anything other than a single image)? Bootstrap doesn't mention that as an option.
Hello @greyhare ! Thanks for pointing this out! I'll looking at it asap. As to why not restricting the child plugins: Some installations have their own Image plugin which is why I refrain from restricting flexibility more than technically necessary.
Thinking of it: Should the caption not be html to allow for bold, italic or whatever? If I change this to a HTML field you'd also get a wrapping <p>...</p>
. This is not in the bootstrap documentation. What do you think?
<figcaption>
can contain flow content, such as paragraphs, though the current stylesheet would likely stuff in an ugly margin.
There is already a need for captions in Blockquote to work better. The example in the Bootstrap docs cannot be implemented in djangocms-frontend because frontend forces the whole caption to be in the <cite>
tag.
The cite tag is a bug there, too. It needs to be removed.
If I turn the caption into an HTMLField text will be surrounded by a paragraph <p>
probably creating the margin that one doesn't want. IHO this p tag can be safely removed as long as there is only one paragraph.
As long as I can mark part of the caption with , sure.
As for the margin, you just need to add a CSS rule that says something like
figure.figure figcaption p:last-child {
margin-bottom: 0;
}
What do you want to mark part of the caption with? Of course, you can always adjust a site's css in a project. 👍 I just do not want to make customized css part of djangcms-frontend.
<cite>
Apparently GitHub doesn't like it without the back ticks.
And sure, you don't want to ship a bunch of customization, but you also don't want the default case to look crappy so someone has to make a djangocms-frontend-fix-the-css
project.
Maybe have some spot in the docs for recommended CSS?
FIxed by #66 😃
Describe the bug The figure plugin doesn't render HTML resembling the Bootstrap 5 spec.
To Reproduce Steps to reproduce the behavior:
figure
orshadow
classes on the figure, nofigure-img
class on the image, and notext-center
class on the caption.Expected behavior A figure with working extra styles and a caption whose alignment you can set.
Desktop (please complete the following information):
Additional context
contrib/content/frameworks.bootstrap5.py
theFigureRenderMixin.render
method is adding the aliugnment to thefigure
tag's classes when it should not (lines 16 and 17).contrib/content/templates/djangocms_frontend/bootstrap5/figure.html
,get_attributes
is misspelled (line 3).contrib/content/templates/djangocms_frontend/bootstrap5/figure.html
, thefigcaption
class should be"figure-caption{% if instance.figure_alignment %} text-{{ instance.figure_alignment }}{% endif %}"
(line 7).figure-img
class to a containedimg
from an Image/Picture plugin. (Also, the Image/Picture plugin has a caption field itself which seems to not be used anywhere...?)