Print

JCI and Google Spreadsheet

Situation:

You have a Google spreadsheet with data. Publish this Spreadshirt as CSV.
With that, you get something like
https://docs.google.com/spreadsheets/d/e/2PACX-1vSUBoYuyFoVPKnD-9sQUEZTbsXvVnoL5A-ydgsdKzw3DSfadYAINI834ZRsgRfSZdTGM99vs4yOty6D/pub?gid=0&single=true&output=csv

Show this data:

Create a JCI-Template with

name: googlespreadsheet

URL: see above

Curl options:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
CURLOPT_FOLLOWLOCATION=TRUE
CURLOPT_FOLLOWLOCATION=TRUE
CURLOPT_FOLLOWLOCATION=TRUE

Twig-template:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<table border=1>
{% for k,v in _parent %}
<tr>
{% for i in 0..((v | length)-1) %}
{% set out = attribute(v, i) %}
<td>{{out}}</td>
{% endfor %}
</tr>
{% endfor %}
</table>
<table border=1> {% for k,v in _parent %} <tr> {% for i in 0..((v | length)-1) %} {% set out = attribute(v, i) %} <td>{{out}}</td> {% endfor %} </tr> {% endfor %} </table>
<table border=1>
{% for k,v in _parent %}
    <tr>
        {% for i in 0..((v | length)-1) %}
            {% set out = attribute(v, i) %}
            <td>{{out}}</td>
        {% endfor %}
    </tr>
{% endfor %}
</table>

Shortcode:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
[jsoncontentimporterpro nameoftemplate=googlespreadsheet inputtype=csv inputtypeparam='{"delimiter": ",", "enclosure": "#QM#", "escape":"#BS#", "csvline": "#LF#", "skipempty": "yes"}']
[jsoncontentimporterpro nameoftemplate=googlespreadsheet inputtype=csv inputtypeparam='{"delimiter": ",", "enclosure": "#QM#", "escape":"#BS#", "csvline": "#LF#", "skipempty": "yes"}']
[jsoncontentimporterpro nameoftemplate=googlespreadsheet inputtype=csv inputtypeparam='{"delimiter": ",", "enclosure": "#QM#", "escape":"#BS#", "csvline": "#LF#", "skipempty": "yes"}']
Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5.0
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.

On this page: