tabulate icon indicating copy to clipboard operation
tabulate copied to clipboard

Add support for file fields (images etc.)

Open witwall opened this issue 9 years ago • 7 comments

My table have image field(both binary and path are ok), does it support? if field is used to store link, if possible to support directly click the link.

witwall avatar Jan 05 '16 08:01 witwall

No I'm afraid that Tabulate does not currently support file attachments. However, support for this definitely is planned; the only questions are around how to best do it.

The current idea is to support blob types, and rather than store the data in them directly, store it in subdirectories of e.g. wp-content/tabulate. The mime type of the attachments could be limited via config settings.

Can you tell me more about your image fields? Types, names, etc?

samwilson avatar Jan 05 '16 08:01 samwilson

how about config the special column type in comment? for example,

Column Name Column Comment
email email
image image
file file
url url

witwall avatar Jan 05 '16 08:01 witwall

Here is an example to implement the controller rapyd-laravel/src/DataForm/Field/

witwall avatar Jan 05 '16 10:01 witwall

https://www.adminer.org/en/pro/features/

Features taken from SQL comments

Adminer features which can not be taken directly from the SQL syntax are taken from the SQL comments. First of all, there could be -- adminer: comment with some global settings. Comment of each individual column is used as its title and there could be special instructions enclosed in curly brackets. E.g. {EMAIL} indicates that the column holds an e-mail address which is checked for correctness and displayed as a link.

witwall avatar Jan 06 '16 02:01 witwall

Yeah I'd been wondering about having some sort of comment syntax, but of course the issue then is that actual column-comments are currently stored there (i.e. end-user help messages or whatever).

I have been thinking that the Options API would be a better place to store this non-MySQL metatdata. What do you think? Akin to how the grants system is currently stored. Or course, we'll need a UI to manage it, but I think that's a worthwhile thing anyway — it'd be great for less-geeky users to not have to use phpMyAdmin or similar.

I'm currently thinking of defining a set of 'friendly' column types, that map to the MySQL type and option value something like the following:

'Friendly' type MySQL type Option
Number INT
Decimal INT
Date DATE
Time TIME
Date & Time DATETIME
Text (long) TEXT
Text (short) VARCHAR
Email VARCHAR email
URL VARCHAR url
File BLOB
Image BLOB image
Cross Reference (i.e. foreign key) INT

It'd be nice to be able to support different types of text-formatting too, for long text fields: HTML, Markdown, RST, plain text, etc. The format could also be stored as an option.

samwilson avatar Jan 06 '16 03:01 samwilson

so we can use another table to store the configure, and wpdatatables is a good example about create table and columns, it is really for end-user.

witwall avatar Jan 06 '16 11:01 witwall

have a look No-CMS, it has most feature I want.

witwall avatar Jan 08 '16 04:01 witwall