BBCode Task Lists

Foxtrek_64

Active member
This is a feature common in GitHub markdown, but I'd also like to see it brought to XenForo, optionally with markdown support!

Task lists are a variation of unordered list which displays checkboxes next to the item (or sometimes in place of the bullet, depending on the implementation). The idea is that it can represent a list of tasks or other items where a state can be indicated.

As an example of use, I am in the progress of setting up plugins on my forum. I could have a thread with known issues, and a checkbox indicating whether the issue has been resolved.

Proposed BBCode:
Code:
[tl]
[ti="checked"]Checked Item[/ti]
[ti="x"]Checked Item but with an x[/ti]
[ti="true"]Checked Item with state of true[/ti]
[ti="unchecked"]Unchecked item[/ti]
[ti="false"]Unchecked item with a state of false[/ti]
[ti]Unchecked item with no argument[/ti]
[/tl]
1713040600793.webp

Markdown has an extended standard for task lists, which should render the same HTML as above:
Code:
- [x] Checked item
- [ ] Unchecked item

In edit mode, clicking the task list item in the List dropdown should behave similarly to inserting an unordered list, except the checkbox should also be visible. This checkbox should not have a disabled state, and the user should be allowed to check or uncheck the item, which affects the checked state of the rendered checkbox.



A basic implementation for the above bbcode using the custom bbcode menu in the ACP is possible. That's how I rendered the screenshot. A PHP callback would be required for some of the more advanced options, but I don't believe this would be much work.

Edit: Here's a live sample from TinyMCE, the editor used in Xenforo 1.x. I'm not suggesting we go back to TinyMCE, but I am providing this link as a way for people to see an example of the functionality I am proposing:
 
Last edited:
Upvote 10
What about making a thread type: task list ?
This is an option here, but I feel it's the most limiting one. If it's a type of bbcode list, then it can be used anywhere bbcode is allowed, which extends far outside of the forum system and into plugins as well. Additionally, it's not uncommon to want some additional free text information along side the task list, which would need to be specifically accounted for.

I could potentially see adding a task list to a post in the same manner as a poll which would resolve the question about free text descriptions, but the point of this is it should be usable anywhere. If we get xf markup for it, the possibility of use extends even further, such as into static pages (for those not using a plugin to allow bbcode pages).
 
Proposed BBCode:
Code:
[tl]
[ti="checked"]Checked Item[/ti]
[ti="x"]Checked Item but with an x[/ti]
[ti="true"]Checked Item with state of true[/ti]
[ti="unchecked"]Unchecked item[/ti]
[ti="false"]Unchecked item with a state of false[/ti]
[ti]Unchecked item with no argument[/ti]
[/tl]

How about something simple like:

Proposed BBCode:
Code:
[tasklist]
[complete]Checked Item[/complete]
[complete]Checked Item[/complete]
[complete]Checked Item[/complete]
[incomplete]Unchecked item[/incomplete]
[incomplete]Unchecked item[/incomplete]
[incomplete]Unchecked item[/incomplete]
[/tasklist]
 
How about something simple like:

Proposed BBCode:
Code:
[tasklist]
[complete]Checked Item[/complete]
[complete]Checked Item[/complete]
[complete]Checked Item[/complete]
[incomplete]Unchecked item[/incomplete]
[incomplete]Unchecked item[/incomplete]
[incomplete]Unchecked item[/incomplete]
[/tasklist]

Definitely open to suggestions here!
That said, given this is a list, I propose we follow the model of the existing lists and use two-letter codes.
This is, in practice, an unordered list with a checkbox for each item. So if it's not a dedicated task list, perhaps a model like this would be better.

Rich (BB code):
[ul]
[li][checkbox="true"] Checked[/li]
[li][checkbox="false"] Unchecked[/li]
[li]No checkbox[/li]
[/ul]
This also has the advantage of better matching the associated bbcode
Markdown (GitHub flavored):
- [x] Checked
- [ ] Unchecked
- No checkbox
 
Last edited:
Back
Top Bottom