Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
how to sort the span elements in meta
jackmaessen
✭✭✭
How can i resort the span elements in the Meta class
The class MItem Category is in my example the last span and i want to bump it up as the first span element in the Meta class
This is the structure i want to achieve:
Discussion title
Discussion Category
Discussion writer with date
Last Comment with date
0
Comments
You would have to override the
writeDiscussion
function with your own markup or use JS to reorder the elements.Overriding the function is "cleaner" but requires you to check for changes when you update Vanilla.
Using JS is simpler but will potentially show the reordering to the user.
I would suggest overriding the function since I hate unnecessary DOM manipulation via JS.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I did modify helper_functions.php in applications/vanilla/views/discussions and it gives me the correct structure. But i feel bad to modify a core file for this, so i was hoping there was another solution to achieve it
You never, ever, modify core files unless you are comfortable maintaining that forked file.
Copy the entirety of the
writeDiscussion
function from/applications/vanilla/views/discussions/helper_functions.php
and paste it into/conf/bootstrap.before.php
. If the before bootstrap file doesn't exist (it doesn't by default), create it.You should have something that looks like this:
Now modify that function as you see fit.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I replaced the original helper_functions.php, created bootstrap.before.php and placed it in config folder and works perfect! So this is a great solution without modifying a core file. Thanks very much @hgtonight