XF 2.1 Extending Froala Table Functionality?

RallyFan

Well-known member
Hi all,

I feel this might be a question that only some of the devs can answer, but if you know the answer feel free to chip in.

Of course keep in mind we are on 2.1 at the moment, and will eventually go to 2.2, so please note if it's only 2.2 compatible.



We use a lot of tables for statistical information and comparisons (as well as cleaner formatting) on our forum, and I have noticed that there isn't a lot out of the box for tables.

For example:
1. Select and centre all fields at once.
2. Resize Columns.
3. Shrink table to collapse (not full width).

Not massive issues, just little niggling things.

Froala offers functionality for #1 and #2 in a plugin (https://froala.com/wysiwyg-editor/docs/plugins/) called table.min.js, which is included with Froala out of the box. I can get around #3 using an addon by Mr Jinx.

This plugin by Froala gives users all this functionality:

1593228957410.png
First 4 buttons (on top row) are the same (as current tables), and the 5th allows dashed borders and/or alternative coloured fields to be toggled.
Row 2 Button 1 - Allows vertical/horizontal cell splitting (probably not too useful).
Row 2 Button 2 - Allows per cell background colour (could be quite useful).
Row 2 Button 3 - Allows vertical alignments (left/centre/right) by selecting multiple fields (very useful).
Row 2 Button 4 - Allows horizontal alignments (left/centre/right) by selecting multiple fields (very useful).
Row 2 Button 5 - Allows you to style tables (may not be very useful).

table.min.js addon also allows cell resizing out of the box: https://froala.com/wysiwyg-editor/examples/resize-table/



So with all this however I have questions:
1. Can this be implemented in Xenforo, or only with a licensed version of Froala?
2. Is if currently an option we can enable in Xenforo in the backend?
3. If it is an option, how would we enable / include it in our forum?

@Kier @Mike @Chris D @Brogan

Appreciate any of your input (and more importantly time) on this one, as I suspect it's something that can only be changed at a development level/with a Froala license.

Happy to be wrong though :)

Oh and awesome job you have all done with Xenforo v2.2 .... super excited for the future :) As you can see, loving horizontal line to break up paragraphs :-)

Cheers :)
 
2.1 already includes the table plugin -- that's how it works. But functionality provided by Froala or plugins is not as directly relevant as you might think. The first and foremost thing is that all functionality would have to be supported in the BB code system. Only then can you consider support in the RTE.

BB code tables simply don't support the various options you want, so the first thing you'd have to do is get that support implemented.
 
Hi Mike,

Thanks for the reply.

The link I posted here: https://froala.com/wysiwyg-editor/examples/resize-table/ shows the various options working (via right click menu).

Correct me if I'm wrong, but isn't that using javascript (to resize columns, etc), not bbcode at that point? As in BBCode is output, but to enable that functionality is via JS (or something)? Keeping in mind I'm far from a programmer :D

Just curious as to how they've managed to add that functionality, as it'd be really handy.

If that makes sense ?
 
I am probably being completely wrong here but the editor in link above is generating html in raw mode. I assume foala doesn't support bbcode at all and xenforo devs have to do that bit themselves? Or bbcode is supported in limited capacity?

I guess this is also the reason why invision is dumping bbcode completely. It has become too restrictive for modern content demands.

I have struggled with tables in xenforo myself due to lack of cell merging and formatting limitations. But I would really hate to end up with a rich editor alone eventually which I guess is where we are going to end up with in a year or two.
 
BB code isn't supported at all, but we handle HTML<->BB code conversions.

But generally, we only expose functions in the editor that actually exist in BB code. Most of the examples mentioned (rowspan, colspan, BG colors, etc) aren't something that are exposed. There isn't anything inherently blocking that but you'd likely need to make a suggestion for the features you'd want to see (if there isn't already one of course :)).
 
Thanks Mike,

So just to get my head around this all, the javascripts required are already included, it's just the code to allow those functions isn't?

Are those functions something that someone could code (or is it easy to enable?), or is it something that Xenforo Development team would need to change to enable that functionality?
 
I believe it could theoretically be done with an add-on.
Thanks so much for your reply on this one.

So would I need to approach someone who creates addons to add this functionality, or is this something perhaps that Xenforo would consider adding?

Would an addon creator know where to look for this (or where would one get started to add such fuctionality)?
 
Top Bottom