MozillaFoundation / foundation.mozilla.org

Mozilla Foundation website
https://foundation.mozilla.org
Mozilla Public License 2.0
384 stars 153 forks source link

[Publications] Hyperlinks and Styling in Tables on Article Pages #6169

Closed sabrinang closed 3 years ago

sabrinang commented 3 years ago

We are using some tables in data futures lab publications. Some of these tables contain links, merged cells and numbered lists but currently we can't do this in the table component in article pages. The stylings may be tricky but would we be able to hyperlinks? Example: the 'initiatives' column in the table below is suppose to link to their website:

image

Seen on: https://foundation.mozilla.org/en/data-futures-lab/data-for-empowerment/alternative-data-governance-approaches-global-landscape-scan-and-analysis/preface/

An example table from the google doc I can try to recreate if we have style options:

image
jamilasnell commented 3 years ago

tables may not be able to contain hyperlinks. this may not be doable :/ Kalob will do some digging to see if we can make this work in some fashion

KalobTaulien commented 3 years ago

@jamilasnell @sabrinang I've been looking into this, this morning. And it's not possible to add structured content into tables. The component uses Handsontable 6.2.2

Merged cells

I tried to enable the Merge Cells, and it worked, but it doesn't seem to be honoured in the template, so that's a no-go without some serious development time. Note: This seems possible to add, but would require allocated dev time and even then has the possibility of not working, and if it doesnt work it would require some wagtail core work to make it work. Lots of unknowns here.

Lists

For lists, which is also a form of structured content, we can use a typed bullet point or manually type the numbers. That's not elegant by any means, but it's a solution that most readers likely wouldn't notice.

Hyperlinks

This isn't supported either. I know someone else on the core team manage to hack the richtext editor into each table cell, and he said "that's a bumpy road to go down". So I guess theoretically this is possible, but not close to being supported.

Alternative solution

We could create a new block type that allows people to create "rows" and "cells" with richtext content in it. We wont be able to migrate the TableBlock to this new proposed block. The benefit of us using something more custom is: a) We can control it better on mobile devices b) We can implement whatever we want into it and aren't restricted to the Table block.

sabrinang commented 3 years ago

Thanks for doing the research on this @KalobTaulien and helping me understand limitations of the tableblock!

From the content use cases I've seen that want to use publications, having hyperlinks and structured content in tables have been quite common so the features would be essential to help move content from docs to publications. I like the alternative solution you proposed with richtext content and the benefits sound like it would solve these table content use cases.

sabrinang commented 3 years ago

@KalobTaulien I think we can close this ticket and would you be able to file a new ticket for the alternative solution your proposed?

KalobTaulien commented 3 years ago

Yep. We opened #6250 out of this ticket.