CSV to html – introduction

Introduction

To use this plugin, you need to create a shortcode. This shortcode could be placed on a page, post, block or widget (if the theme supports shortcodes for widgets). The shortcode defines which files to fetch and how the generated html-table should be created. The shortcode always start with [csvtohtml_create followed by attributes and their values], e.g. [csvtohtml_create {attribute}=”{value}” {attribute}=”{value}” etc]

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.
20112012201320142015
Sweden1.6%2.2%3.2%4.5%6.9%