The source_type attribute defines what kind of structure the fetched file(s) has. visualizer_plugin is set as default. This is because the plugin was made for that format from the beginning (Initially this plugin was made for generating tables from charts fething data from the Visualizer Plugin (https://wordpress.org/plugins/visualizer/). If you are having problem fetching the data – try to to use ”guess” instead (it’s a more ordinary case to use guess).
Valid source types:
- guess
- json
- visualizer_plugin
- (Visualizer plugin) example data:
- ,Sweden
- 2010,number
- 2011,"1.6%"
- 2012,"2.2%"
- 2013,"3.2%"
- 2014,"4.5%"
- 2015,"6.9%"
Shortcode
[csvtohtml_create source_type="visualizer_plugin" path="csvfiles" source_files="sweden.csv"]
path defines relative path from the servers upload-folder (e.g. wp-content/uploads/csvfiles).
If path is not defined, then wp-content/uploads is used.
Sweden | 1.6% | 2.2% | 3.2% | 4.5% | 6.9% |
Combine files
If you want to have data from serveral files into one table, just add them in the source_files separated with a semicolon.
Shortcode
[csvtohtml_create source_type="visualizer_plugin" path="csvfiles" source_files="sweden.csv;norway.csv;finland.csv"]
Sweden | 1.6% | 2.2% | 3.2% | 4.5% | 6.9% |
Norway | -6.6% | 1.2% | 1.4% | 1.9% | 2.0% |
Finland | -16.6% | -14.2% | 10.2% | 11.0% | 13.2% |
Combine files into one table with a ”wildcard”.
If you want to have data from serveral files into one table, just add the wildcard, like *.csv or *.*. This is only applicapble when dealing with csv-files locally (on the webserver where your site is stored). If any files are added to the given path, those files are included in the generation of the table. (The reason why Sweden is shown twice below is that there are two files with identical data on this server in the csv-files folder (sweden.csv and sweden_mac.csv))
Shortcode
[csvtohtml_create source_type="visualizer_plugin" path="csvfiles" source_files="*.csv"]
Denmark | -2.6% | 0% | 2.6% | 2.9% | 2.11% |
Finland | -16.6% | -14.2% | 10.2% | 11.0% | 13.2% |
Iceland | 6.6% | 6.2% | 7.2% | 11.0% | 16.2% |
Norway | -6.6% | 1.2% | 1.4% | 1.9% | 2.0% |
Sweden | 1.6% | 2.2% | 3.2% | 4.5% | 6.9% |
Sweden2010 |
External files
With CSV to HTML it is also possible to fetch data from external files (the files does not have to be on your own server). Down below is actually a mix of an external file (https – sweden) and internal files (norway,finland,iceland,denmark):
Shortcode
[csvtohtml_create source_type="visualizer_plugin" path="csvfiles" source_files="https://wibergsweb.se/wp-content/uploads/csvfiles/sweden.csv;norway;finland;iceland;denmark"]
Sweden | 1.6% | 2.2% | 3.2% | 4.5% | 6.9% |
Norway | -6.6% | 1.2% | 1.4% | 1.9% | 2.0% |
Finland | -16.6% | -14.2% | 10.2% | 11.0% | 13.2% |
Iceland | 6.6% | 6.2% | 7.2% | 11.0% | 16.2% |
Denmark | -2.6% | 0% | 2.6% | 2.9% | 2.11% |
It’s also possible to fetch google sheets if adding some attributes to the url and setting an attribute for the shortcode (add_ext_auto). This add_ext_auto adds the file extension .csv as default. When dealing with google sheets (or maybe some other source) you don’t want any file extension to be added.
Shortcode
[csvtohtml_create source_type="guess" add_ext_auto = "no" source_files="https://docs.google.com/spreadsheets/d/{key}/gviz/tq?tqx=out:csv&sheet={sheet_name}"]
There are no preview for this because google sheet’s specification how to achieve this usually do change over time. Please take a look at https://stackoverflow.com/questions/33713084/download-link-for-google-spreadsheets-csv-export-with-multiple-sheets for some ideas how to fetch your google sheets document as a csv file.
But here’s an example of how it could work: (With permission from https://www.tsg1898-segeln.de/termine/). This example fetches a google document, but not at every single request. When a request is done it checks if an hour has passed. If it has, then google document is fetched again. This is relevant when you fetch external files. Fetch interval options are: hourly, daily, weekly or once. (Once means you only fetch the external file once once).
Shortcode
[csvtohtml_create fetch_interval="hourly" html_id="termine" design_template="no" source_type="guess" add_ext_auto="no" source_files="https://docs.google.com/spreadsheets/d/1qfLHc3jBDXChnexYKL4BcDOwljcsWEQnKerb_0tL7Fs/gviz/tq?tqx=out:csv&sheet=TSG_Termine" responsive="no" grabcontent_col_fromlink="Link" grabcontent_col_tolink="Aktivität" hide_cols="Link" markdown_support="yes"]
Januar 2025 | ||||
09.01. | Vorstand TSG | 19:00 Uhr | ||
19.01. | Bowling (A10 Center Wildau) | 16:00 Uhr | ||
Februar 2025 | ||||
13.02. | Vorstand TSG | 19:00 Uhr | ||
15.02. | Kenntertraining (Schwapp Fürstenwalde) | 09:00 Uhr | ||
15.02. | Mitgliederversammlung | 16:00 Uhr | ||
22.02. | Athletikpokal (BSV, Flatow-Schule) | |||
23.02. | Winterwanderung | 11:00 Uhr | ||
März 2025 | ||||
08.03. | Eisbeinessen (auch vegetarisch) / Fahrtenseglerehrung | 18:30 Uhr / 19:00 Uhr | ||
13.03. | Vorstand TSG | 19:00 Uhr | ||
29./30.03. | Abslippen | 09:00 Uhr | ||
April 2025 | ||||
05.04. | Abslippen | 09:00 Uhr | ||
05.04. | Auslagern Jugendboote | 11:00 Uhr | ||
05.04. | Jahreshauptversammlung | 16:00 Uhr | ||
10.04. | Vorstand TSG | 19:00 Uhr | ||
12.04. | Ansegeln TSG intern | 11:00 Uhr | ||
12.04. | Ansegeln Revier (VSW) | 13:00 Uhr | ||
Mai 2025 | ||||
03./04.05. | Ali-Wahrendorf-Preis (20er JK) | |||
10./11.05. | 1. + 2. Interne | 11:00 Uhr | ||
15.05. | Vorstand TSG | 19:00 Uhr | ||
17.05. | Mitgliederversammlung | 19:00 Uhr | ||
24.05. | Edgar-Jambor-Preis (Opti C) | |||
29.05.-01.06. | Trainingslager Himmelfahrt (Opti, ILCA, 420er) | |||
Juni 2025 | ||||
06.06. | Arbeitsdienst | 16:00 Uhr | ||
07./08.06. | TSG-Cup (Yardstick) | |||
09.06. | Arbeitsdienst | 10:00 Uhr | ||
12.06. | Vorstand TSG | 19:00 Uhr | ||
14./15.06. | Geldner-Preis (O-Jolle) | |||
22.06. | 3. Interne | 11:00 Uhr | ||
Juli 2025 | ||||
10.07. | Vorstand | 19:00 Uhr | ||
12.07. | Fahrtenseglerausfahrt | |||
24.07. - 27.07. | Trainingslager Ferienbeginn (Opti, ILCA, 420er) | |||
August 2025 | ||||
31.08. - 06.09. | Trainingslager Ueckermünde (Opti, ILCA, 420er) | |||
September 2025 | ||||
11.09. | Vorstand TSG | 19:00 Uhr | ||
13.09. | Fahrtenseglerausfahrt | |||
27.09. | Arbeitsdienst | 10:00 Uhr | ||
27.09. | Mitgliederversammlung | 19:00 Uhr | ||
28.09. | 4. Interne | 11:00 Uhr | ||
Oktober 2025 | ||||
09.10. | Vorstand TSG | 19:00 Uhr | ||
11.10. | Absegeln TSG intern inkl. Siegerehrung interne Wettfahrten | 11:00 Uhr | ||
11.10. | Absegeln Revier (WSV 1921) | 13:00 Uhr | ||
18.10. | Einlagern Jugendboote | 10:00 Uhr | ||
25./26.10. | Aufslippen | 09:00 Uhr | ||
November 2025 | ||||
01.11. | Aufslippen | 09:00 Uhr | ||
01.11. | Mitgliederversammlung | 16:00 Uhr | ||
13.11. | Vorstand TSG | 19:00 Uhr | ||
29.11. | Jubilarfeier | 15:00 Uhr | ||
Dezember 2025 | ||||
07.12. | Glühweinsegeln (Bad Saarow) | |||
13.12. | Weihnachtsfest für Jung und Alt | |||
31.12. | Silvesterfeier |