Follow-up from #2108319: Style comments as this applies to 7.x-3.x too.
As we need to style the whole comment template (very ugly atm. especially when users got profile images) i've done some initial work.
There aren't many examples for comments with bootstrap 3, so this is free to us.
My work isn't finished and i'm not lucky with the look of my work. I'm more a programmer. But it's a start.
Maybe @markcarver could say something to comment styling.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | 2109369-19.png | 146.34 KB | grimreaper |
| #19 | bootstrap-media_component-2109369-18.patch | 5.14 KB | grimreaper |
| #6 | bootstrap-use-media-object-as-comments-2109369-6.patch | 5.08 KB | valkum |
| #5 | bootstrap-use-media-object-as-comments-2109369-5.patch | 5.08 KB | valkum |
| #1 | Screenshot from 2013-10-11 12:53:20.png | 46.76 KB | tr33m4n |
Comments
Comment #1
tr33m4n commentedI ended up using panels for styling comments in a project that uses 3.x-dev, thought it turned out pretty well. Maybe a panels based solution?
Comment #2
matthewtrow commentedMay it not be wise to make use of variables for anything within this overrides file which is bespoke?
Looking at the current overrides file, it really isn't doing things "the bootstrap way" - hardcoded values - padding, z-index, margins, borders, colours.
There's stuff like 'float: right', instead of, perhaps, .pull-right ?
It's a mish-mash of styles all dumped into a single file that makes it difficult to easily modify.
'modular' sections, such as comments, could be in their own comments.less file ?
Sorry for what looks like a minor rant - really loving this theme and hope to be able to assist in it's development.
Comment #3
valkum commentedMatthewtrow, i totally agree with your points. As I said, im not happy with my work.
Maybe we should use media objects [1], but tr33m4ns work looks very good too.
But as mentioned in the docs media objects it is meant to build blog comments with this abstract object.
[1] http://getbootstrap.com/components/#media
Comment #4
markhalliwell@matthewtrow, to give a little history the "overrides" file has been a mixmash of different css styles over the years and the various bootstrap projects. Yes, it does need to be cleaned up. At this moment though, I'm honestly not too concerned with it.
@tr33m4n, this indeed looks awesome, but also very site specific. I'm not sure if we want to go this route for a base theme. Also using panels is not really an option for this base theme, we simply need to provide styling for core comments/templates. Many sites implement comments in a variety of ways: panels, display suite, disqus, facebook. We cannot simply choose one of these over the other and must remain as neutral as possible.
@valkum, here's a review
I'm pretty sure you probably wouldn't put
div.in unless it's absolutely needed. Is it?Unnecessary whitespace
space after :
style needs indention
Comment #5
valkum commentedi talked to markcarver in irc and we discussed how to style the comments.
We think Bootstraps media objects would be the best solution.
The problem is, drupal doesn't create nested commets, rather it adds per level of depth one div with class indented.
So mark thinks it would be the best to create our own render array with nested comments.
I wasn't able to achieve this, as we need to alter comment_node_page_additions [1] fot this i think.
I tried another way and use the drupal html structure and let it work like the bootstrap structure.
So i use the media object bat rather than use nested divs i indent the width of the user profile image.
attached is my patch.
Maybe we could add some badges for new comments and some fancy stuff.
[1] https://api.drupal.org/api/drupal/modules!comment!comment.module/functio...
Comment #6
valkum commentedremoved the whitespace.
Comment #7
valkum commentedComment #8
tr33m4n commented@Mark Carver, yeah I totally agree actually however think you may have got the wrong end of the stick, panels as in Bootstrap 3 panels, not the module panels
Comment #9
markhalliwell@tr33m4n: ah, yep that gets confusing sometimes lol I still like using the
.mediastyles for comments though, since.panelis used for fieldset. Don't want to confuse the two.Marking this as a feature request, since we never had comment style/support before.
Comment #10
stopshinal commentedValkum thanks for this patch - i've applied and it is a good first step. I"m trying to decide if this is the most sustainable approach right now. Do you have any other idears?
Comment #11
markhalliwellI'm going to postpone this issue for now (since it's a feature request). We can introduce this after we make a release and since I'd prefer to do this properly.
Comment #12
zilla commentedseems that users can style in panels or display suite for the time being - though a basic setup for handling replies and some very basic styling or presentation would be nice out of the box, since there's a lot of commenting on a lot of drupal sites and bootstrap is gaining serious popularity....(honestly, what about just putting comments into something like a well by default? or a lightly styled container of some kind?
update: just saw that comment about bootstrap panel above, that also makes sense (though still wondering about support for replies to comments and indentation as discussed in other threads...
Comment #15
markhalliwell.
Comment #16
delacosta456 commentedHi just as a suggestion
Can we have option to get a style that looks like Bartik's theme Comment' .. (with arrow ) it look's smooth and fine.
thanks
Comment #17
tepelena commentedI agree with delacosta456 that even the Bartik's theme comment layout would be a lot better than the Bootstrap comments.
For now I am just using Display suite to format the way that the comment content looks.
Comment #18
markhalliwellThen provide a patch instead of complaining about it.
Comment #19
grimreaperHello,
Here is an attempt to provide a patch for this issue as I would also like really cool comments themed the Bootstrap way.
The main problem I have is that in addition to the template in the patch, it requires to alter the CommentViewBuilder, I don't know why in hook_preprocess_comment or in preprocess plugins (of the Bootstrap D8 theme) I can't alter the #prefix and #suffix...
So here is the code of core/modules/comment/src/CommentViewBuilder.php::alterBuild:
The other thing I am not very ok with, is that the comment template has not closing markup. It was needed because of the nested structure of the Bootstrap media list. Core adds indentation div but it wraps comments.
Thanks for the review and feedbacks.
Comment #20
markhalliwellThis feature is and has been the lowest on the list. Furthermore, it's a radical change that will need some thorough attention from myself, time I simply do not have at the moment.
One day.
Comment #21
markhalliwellLet's see if we can get this in 8.x-4.x.
Comment #22
renguer0 commentedSo, no more updates here? Still moved to low priority?
Styled comments could be really great to improve engagement in our sites.
Comment #23
shelaneThis theme will not be supported for Bootstrap 4. See alternative themes for this support.