Elgg 2x enlists comments in chronological order but Elgg 3x makes it reverse, So what is the best and easy way to preserve the comment orders while upgrading from Elgg2x to Elgg3x. I cannot remember any community discussions asking for such a change but still it is there in Elgg 3x rather unexpectedly.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Rohit Gupta@Rohit_1990_3676
Rohit Gupta - 0 likes
- Create your own plugin
- Create a file views/default/river/elements/responses.php
- Copy the source code from vendor/elgg/elgg/views/default/object/comment.php to your plugin at mod/yourplugin/views/default/object/comment.php
- Change DESC to ASC in your plugin from line 28 (https://github.com/Elgg/Elgg/blob/5cdd3b80680c4f4d90afeb4cce97bd987a21a5b6/views/default/river/elements/responses.php#L38)
- Lastly remove or comment out array_reverse from line 45 (https://github.com/Elgg/Elgg/blob/5cdd3b80680c4f4d90afeb4cce97bd987a21a5b6/views/default/river/elements/responses.php#L45)
- kanha@kanha
kanha - 0 likes
- Rohit Gupta@Rohit_1990_3676
Rohit Gupta - 0 likes
- iionly@iionly
iionly - 1 like
- kanha@kanha
kanha - 0 likes
You must log in to post replies.You can easily do it by following these steps
Hope this help.
Thanks, I will try to do this. But my basic coding skills (or whatever) are dwindling with age. Please also consider releasing a community plugin, as everyone (or majority) upgrading from 2x to 3x will be needing this, otherwise users of upgraded sites will suddenly find comment orders changed. Many thanks again.
PS: Yet another sudden unexpected change in 3x: comment box by default is collapsed. Any css trick to keep it opened by default?
PS2 : You or any plugin dev would like to develop reply to comments, this was present in hype plugins but that is now in dead pool I guess.
Well, you have to look for some other developer for this. I don't need the old comment system, hence I will not be developing a plugin for this. (PS: I am in favour of the new comment system.)
Comment order can be reversed quite easily. There's a plugin hook for that now in Elgg 3. Just create a theme with the following code in start.php:
Add a manifest.xml file, e.g.
and the plugin is complete and the comments are again listed the ascending order (oldest first).
As a sidenote: the number of comments displayed on a page can be configured in a similar manner using the 'config', 'comments_per_page' plugin hook. If the default number of 25 should be changed it's just necessary to register a plugin hook function that returns the desired number of comments to be displayed per page.
A whole world of thanks goes to Rohit Gupta and Iionly. Any idea on how to keep the comment box opened by default (as in Elgg 2x) in Elgg 3x.
@Rohit Gupta, I am also in FULL favour of new comments. What I meant is that: one cannot reply to a reply (comment) in Elgg. This is, however, possible in real world social nets (like facebook) or in all other php social scripts (like Buddypress, Peepso, Easysocial) etc, EXCEPT in Elgg. This type of comments act as a social feature that enhances community participation, imho. Many thanks.