Hi everyone,
The Encyclopedia template is one of the few templates we bundle in XWiki Standard. While working on XWIKI-20712 I noticed that it has some issues:
- The text doesn’t extend below the boxes on the right. The template basically has two columns, but the second (right) “column” (with the boxes) is most of the time way shorter than the first. This means there is a lot of space lost on the second column, below the boxes. I know that long lines of text are harder to read than short-width columns, but I don’t think this was the purpose here (to make the “content column” thinner). As its name suggests, the template is actually trying to provide a layout similar to the one from Wikipedia, where the text is expanding below the right boxes.
- Sections titles are missing the Edit pencil icon, because the headings are wrapped in some
DIV
HTML tags. - The wiki syntax is using the group XWiki syntax
(% class="box" %)(((...)))
instead of the Box macro, probably because the Box macro was not editable in-line when this template was written. - The wiki syntax is more complex than it should be, making it harder to edit with the WYSIWYG editor. In general, CKEditor editing experience when your content has
DIV
tags is not the best, so we should try to avoid it, if possible. It’s fine when thoseDIV
tags come from a macro (ideally editable inline), because they are read-only.
I’d like to update the content of the Encyclopedia template to fix the mentioned issues:
- use the Box macro for the right boxes
- wrap the 2 right boxes in a
floatinginfobox
DIV, so that the text extends below them- Remove the top margin (6px) from the
floatinginfobox
to align it with the content of the left. I think this makes sense in all cases whenfloatinginfobox
is used. - Increase the left and bottom margin to match the
@grid-gutter-width
. I think it makes sense to have this kind of spacing for thefloatinginfobox
in general.
- Remove the top margin (6px) from the
- improve the styling so that the background color of the jumbotron doesn’t go below the right boxes
.floatinginfobox + .jumbotron { overflow-x: auto; }
- Remove unnecessary DIV wrappers from the content, so that sections get their edit icon.
The result:
- Before
- After
Note that this also improves the result in the PDF export.
- Before
- After
WDYT?
Thanks,
Marius