Fetches a table from Google Sheet

Data coming from https://docs.google.com/spreadsheets/d/e/2PACX-1vTEbblQfWW2ZjGlt1bXO59yixftz9Ok1dnDuCMIOYyk-Gow4mkxolXOsj_iECGDKHq9j1xNHQcdC8lw/pub

Filtering works particularly well with webservices (or single database database tables). Examples:


  • Constance,Phi: police officer
  • Emelina,Kress: police officer
  • Susette,Teryn: police officer
  • Netty,Seessel: police officer
  • Latisha,Goode: police officer
  • Candy,Pauly: police officer
  • Annora,Redmond: police officer
  • Merci,Gombach: police officer
  • Madelle,Keily: police officer
  • Eadie,Byrne: police officer
  • Nerta,Moseley: police officer
  • Ida,Old: police officer
  • Bertine,Justinn: police officer
  • Jaclyn,Eachern: police officer
  • Michaelina,Dunkin: police officer
  • Therine,Laurianne: police officer
  • Marguerite,Ehrman: police officer
  • Bill,Garrison: police officer
  • Cissiee,Ochs: police officer

    ---
title: Google Sheet
@collection:
    model: webservice
    config:
        url: https://docs.google.com/spreadsheets/d/e/2PACX-1vTEbblQfWW2ZjGlt1bXO59yixftz9Ok1dnDuCMIOYyk-Gow4mkxolXOsj_iECGDKHq9j1xNHQcdC8lw/pub?output=csv
    state:
        limit: 20
@process:
    filters: highlight
---
    <style>
    /* adding some quick styling for the automatic Pagination made by Pages */
    ul.k-pagination__pages {
        display: flex;
        justify-content: space-between;
        list-style-type: none;
    }
    /* just removing the icon-next icon coming along with Protostar */
    ul.k-pagination__pages li.icon-next:before { content:unset;}
</style>

<h2>Fetches a table from Google Sheet</h2>
<p>Data coming from <a target="_blank" href="https://docs.google.com/spreadsheets/d/e/2PACX-1vTEbblQfWW2ZjGlt1bXO59yixftz9Ok1dnDuCMIOYyk-Gow4mkxolXOsj_iECGDKHq9j1xNHQcdC8lw/pub">https://docs.google.com/spreadsheets/d/e/2PACX-1vTEbblQfWW2ZjGlt1bXO59yixftz9Ok1dnDuCMIOYyk-Gow4mkxolXOsj_iECGDKHq9j1xNHQcdC8lw/pub</a></p>

<p>Filtering works particularly well with webservices (or single database database tables). Examples:</p>
<ul>
    <li><a href="https://pages.joomlacustomfields.org/gsheet2?filter[profession]=jedi">https://pages.joomlacustomfields.org/gsheet2?filter[profession]=jedi</a></li>
    <li><a href="https://pages.joomlacustomfields.org/gsheet2?filter[profession]=doctor">https://pages.joomlacustomfields.org/gsheet2?filter[profession]=doctor</a></li>
    <li><a href="https://pages.joomlacustomfields.org/gsheet2?filter[profession]=police%20officer">https://pages.joomlacustomfields.org/gsheet2?filter[profession]=police%20officer</a></li>
</ul>

<hr>

<div class="well">
<ul>
<? foreach(collection() as $person) :  ?>
	<li>
		<?= $person->firstname ?>,<?= $person->lastname ?>: <?= $person->profession ?>
	</li>
<? endforeach; ?>
</ul>
<?= helper('paginator.pagination') ?>
</div>
<hr>

<?= source('/gsheet2') ?>

<hr>

<h3>See hereafter the var_dump(collection())</h3>
<pre><code><?= var_dump(collection()); ?></code></pre>

See hereafter the var_dump(collection())

object(ComPagesModelEntityItems)#1743 (19) {
  [101]=>
  array(6) {
    ["id"]=>
    string(3) "101"
    ["firstname"]=>
    string(9) "Constance"
    ["lastname"]=>
    string(3) "Phi"
    ["email"]=>
    string(23) "Constance.Phi@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(1)
  }
  [105]=>
  array(6) {
    ["id"]=>
    string(3) "105"
    ["firstname"]=>
    string(7) "Emelina"
    ["lastname"]=>
    string(5) "Kress"
    ["email"]=>
    string(23) "Emelina.Kress@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(2)
  }
  [116]=>
  array(6) {
    ["id"]=>
    string(3) "116"
    ["firstname"]=>
    string(7) "Susette"
    ["lastname"]=>
    string(5) "Teryn"
    ["email"]=>
    string(23) "Susette.Teryn@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(3)
  }
  [117]=>
  array(6) {
    ["id"]=>
    string(3) "117"
    ["firstname"]=>
    string(5) "Netty"
    ["lastname"]=>
    string(7) "Seessel"
    ["email"]=>
    string(23) "Netty.Seessel@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(4)
  }
  [119]=>
  array(6) {
    ["id"]=>
    string(3) "119"
    ["firstname"]=>
    string(7) "Latisha"
    ["lastname"]=>
    string(5) "Goode"
    ["email"]=>
    string(23) "Latisha.Goode@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(5)
  }
  [122]=>
  array(6) {
    ["id"]=>
    string(3) "122"
    ["firstname"]=>
    string(5) "Candy"
    ["lastname"]=>
    string(5) "Pauly"
    ["email"]=>
    string(21) "Candy.Pauly@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(6)
  }
  [126]=>
  array(6) {
    ["id"]=>
    string(3) "126"
    ["firstname"]=>
    string(6) "Annora"
    ["lastname"]=>
    string(7) "Redmond"
    ["email"]=>
    string(24) "Annora.Redmond@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(7)
  }
  [132]=>
  array(6) {
    ["id"]=>
    string(3) "132"
    ["firstname"]=>
    string(5) "Merci"
    ["lastname"]=>
    string(7) "Gombach"
    ["email"]=>
    string(23) "Merci.Gombach@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(8)
  }
  [135]=>
  array(6) {
    ["id"]=>
    string(3) "135"
    ["firstname"]=>
    string(7) "Madelle"
    ["lastname"]=>
    string(5) "Keily"
    ["email"]=>
    string(23) "Madelle.Keily@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(9)
  }
  [137]=>
  array(6) {
    ["id"]=>
    string(3) "137"
    ["firstname"]=>
    string(5) "Eadie"
    ["lastname"]=>
    string(5) "Byrne"
    ["email"]=>
    string(21) "Eadie.Byrne@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(10)
  }
  [138]=>
  array(6) {
    ["id"]=>
    string(3) "138"
    ["firstname"]=>
    string(5) "Nerta"
    ["lastname"]=>
    string(7) "Moseley"
    ["email"]=>
    string(23) "Nerta.Moseley@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(11)
  }
  [155]=>
  array(6) {
    ["id"]=>
    string(3) "155"
    ["firstname"]=>
    string(3) "Ida"
    ["lastname"]=>
    string(3) "Old"
    ["email"]=>
    string(17) "Ida.Old@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(12)
  }
  [156]=>
  array(6) {
    ["id"]=>
    string(3) "156"
    ["firstname"]=>
    string(7) "Bertine"
    ["lastname"]=>
    string(7) "Justinn"
    ["email"]=>
    string(25) "Bertine.Justinn@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(13)
  }
  [159]=>
  array(6) {
    ["id"]=>
    string(3) "159"
    ["firstname"]=>
    string(6) "Jaclyn"
    ["lastname"]=>
    string(7) "Eachern"
    ["email"]=>
    string(24) "Jaclyn.Eachern@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(14)
  }
  [168]=>
  array(6) {
    ["id"]=>
    string(3) "168"
    ["firstname"]=>
    string(10) "Michaelina"
    ["lastname"]=>
    string(6) "Dunkin"
    ["email"]=>
    string(27) "Michaelina.Dunkin@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(15)
  }
  [173]=>
  array(6) {
    ["id"]=>
    string(3) "173"
    ["firstname"]=>
    string(7) "Therine"
    ["lastname"]=>
    string(9) "Laurianne"
    ["email"]=>
    string(27) "Therine.Laurianne@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(16)
  }
  [191]=>
  array(6) {
    ["id"]=>
    string(3) "191"
    ["firstname"]=>
    string(10) "Marguerite"
    ["lastname"]=>
    string(6) "Ehrman"
    ["email"]=>
    string(27) "Marguerite.Ehrman@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(17)
  }
  [195]=>
  array(6) {
    ["id"]=>
    string(3) "195"
    ["firstname"]=>
    string(4) "Bill"
    ["lastname"]=>
    string(8) "Garrison"
    ["email"]=>
    string(23) "Bill.Garrison@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(18)
  }
  [196]=>
  array(6) {
    ["id"]=>
    string(3) "196"
    ["firstname"]=>
    string(7) "Cissiee"
    ["lastname"]=>
    string(4) "Ochs"
    ["email"]=>
    string(22) "Cissiee.Ochs@gmail.com"
    ["profession"]=>
    string(14) "police officer"
    ["ordering"]=>
    int(19)
  }
}