This section describes how to install the plugin and get it working. There are actually three steps. 1. Load csv-file or files into your wp-content/uploads directory. 2. Apply settings in form or manually in shortcode generator. 3. Copy and paste into page/post/widget.
Look at inspirational examples of what you can do with the plugin here: http://wibergsweb.se/plugins/csvtohtml/
A more detailed descrption of how to get this plugin working:
STEP1 – INSTALLATION
1. Upload the plugin folder csvtohtml to the `/wp-content/plugins/’ directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the ‘Plugins’ screen in WordPress
STEP2 – PREPARATION
The plugin can either fetch files locally from your server (or from an external resource). The plugin supports csv-files, Excel(xlsx-files only), ods-files (spreadsheet) and json-files. If using a json-file then you should set source type to JSON. In most cases the source type should be set to guess if not using JSON.
Local fetch
- Create a folder called csvtohtmlfiles in your wp-content/uploads/ manually (e.g. wp-content/uploads/csvtohtmlfiles should be created)
- Upload/copy your file to this created folder (e.g. wp-content/uploads/csvtohtmlfiles/testfile.csv). This cannot be done from media-upload (Use ftp, ssh or directly on your os to copy files to the webserver).
External fetch
- Have an uri to your csv-file available/accessible from your computer (eg. https://[domain]/testfile.csv).
STEP3 – SHORTCODE GENERATOR
1. Begin to understand what you are able to to do with the plugin. Do this by playing around with the CSV to HTML shortcode generator. This is accessible in the admin dashboard – CSV to HTML/Shortcode generator or through the plugins page. Do this on a desktop computer for easiest management.
2. Try and click/modify settings and see the preview of the table to the right. This preview only shows how it would look like, but functionality such as search and pagination etc isn’t going to work.
3. If you want to see the current output based on applied settings, then you should click the update/preview – button.
4. Settings are splitted into different sections in the shortcode generator page.
5. The section "Debugging" shows known errors and gives warnings depending on your settings. It turns into red when there are any errors or warnings. This doesn’t necessarily mean it won’t work but can be an indicator of somethings you must adjust.
6. You should see the "File management" section as a starting point for your settings. By default all csv files that exists in wp-content/uploads are used to generate a table (*.csv).
7. Change *.csv to the name of the file you prepared in STEP2.
Local fetch
- Set Path(local) to csvtohtmlfiles or click on the button with three dots and select csvtohtmlfiles (if you have done previous steps you should see your folder csvtohtmlfiles here). In Fetch file(s) type the file(s) that you put into wp-content/uploads/csvtohtmlfiles
- If an Excel-file is selected for fetch, then it is converted to a csv-file and the Excel-file remains intact (so there are two files that has identical data in the same folder). This may seem redudantant, but this is because the plugin fetches data from the csv-file and not from the Excel-file directly.
External fetch
- In File(s) combined to this table put in your url that you prepared in STEP2. If your external file is a google spreadsheet, make sure it’s publicy available for download and that you have the full uri to your googlesheets workbook. Also set "add extension automatically" to no.
- If you have more files you want to combine, then just add a semicolon (;) and add filename (local or external)
STEP4 – MAKE IT WORK
10. Play around with settings until you’re satisfied. In very few cases you should change character encodings but if you’re having issues with encoding, you could try and change these settings.
11. Copy generated shortcode and put the shortcode in a wordpress page or post to display table with the functionality you have set in the shortcode generator page.
12. If you don’t like the default design of the table(s), use your theme’s css to change the layout of your site/table etc.
SHORTCODE
You can apply settings through text inputs, radiobuttons, select lists etc or simply adjust shorcode directly and click for a new preview/update. When you are done, simply paste the shortcode into a post or page (or widget if theme supports that).
If having issues that you cannot solve please send a mail to info@wibergsweb.se.
If you like the plugin, please consider donating. Please donate to paypal info@wibergsweb.se. Amount does not matter. I like coffee! 🙂