Skip to content

Instantly share code, notes, and snippets.

@pvledoux
Forked from croxton/entries_archive.md
Created August 13, 2013 11:22
Show Gist options
  • Save pvledoux/6220195 to your computer and use it in GitHub Desktop.
Save pvledoux/6220195 to your computer and use it in GitHub Desktop.

Revisions

  1. @croxton croxton revised this gist Aug 13, 2013. 1 changed file with 1 addition and 43 deletions.
    44 changes: 1 addition & 43 deletions entries_archive.md
    Original file line number Diff line number Diff line change
    @@ -109,49 +109,7 @@ Example output:
    <li> Ashton &amp; Bentley (2013-02-27) </li>
    <li> Agape (2013-02-27) </li>
    </ul>
    <h1>
    2013
    </h1>
    <h2>
    May
    </h2>
    <ul>
    <li> Vitra (2013-05-08) </li>
    <li> Victoria + Albert Baths (2013-05-08) </li>
    <li> Vado (2013-05-08) </li>
    <li> NotOnlyWhite (2013-05-08) </li>
    <li> Kaldewei (2013-05-08) </li>
    <li> Bisque (2013-05-01) </li>
    <li> Hansgrohe (2013-05-01) </li>
    <li> Majestic Showers (2013-05-01) </li>
    <li> Inda (2013-05-01) </li>
    <li> Grohe (2013-05-01) </li>
    <li> Fantini (2013-05-01) </li>
    </ul>
    <h2>
    April
    </h2>
    <ul>
    <li> Kanth (2013-04-12) </li>
    <li> Bette (2013-04-10) </li>
    </ul>
    <h2>
    February
    </h2>
    <ul>
    <li> PomD’or (2013-02-27) </li>
    <li> Vola (2013-02-27) </li>
    <li> Lefroy Brooks (2013-02-27) </li>
    <li> Laufen (2013-02-27) </li>
    <li> Falper (2013-02-27) </li>
    <li> Flaminia (2013-02-27) </li>
    <li> Dornbracht (2013-02-27) </li>
    <li> Bard &amp; Brazier (2013-02-27) </li>
    <li> Graff (2013-02-27) </li>
    <li> Ashton &amp; Bentley (2013-02-27) </li>
    <li> Agape (2013-02-27) </li>
    </ul>

    <h1>
    2012
    </h1>
  2. @croxton croxton revised this gist Aug 13, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion entries_archive.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    {exp:stash:set_list name="entries" parse_tags="yes"}
    {exp:stash:set_list name="entries" parse_tags="yes"}
    {exp:channel:entries channel="my_channel" orderby="date" sort="desc" dynamic="no" limit="999"}
    {stash:title}{title}{/stash:title}
    {stash:date_day}{entry_date format="%d"}{/stash:date_day}
  3. @croxton croxton revised this gist Aug 13, 2013. 2 changed files with 180 additions and 65 deletions.
    65 changes: 0 additions & 65 deletions entries_archive
    Original file line number Diff line number Diff line change
    @@ -1,65 +0,0 @@
    {exp:stash:set_list name="entries" parse_tags="yes"}
    {exp:channel:entries channel="my_channel" orderby="date" sort="desc" dynamic="no" limit="999"}
    {stash:title}{title}{/stash:title}
    {stash:date_day}{entry_date format="%d"}{/stash:date_day}
    {stash:date_month}{entry_date format="%m"}{/stash:date_month}
    {stash:date_year}{entry_date format="%Y"}{/stash:date_year}
    {stash:date_sort}{entry_date format="%Y-%F"}{/stash:date_sort}
    {stash:date_machine}{entry_date}{/stash:date_machine}
    {/exp:channel:entries}
    {/exp:stash:set_list}

    {!-- make a copy containing only the years, so we can find all unique years--}
    {exp:stash:set_list name="years" parse_tags="yes"}
    {exp:stash:get_list name="entries"}
    {stash:date_year}{date_year}{/stash:date_year}
    {/exp:stash:get_list}
    {/exp:stash:set_list}

    {!-- make list of months in reverse order --}
    {exp:stash:set_list name="months"}
    {stash:month}December{/stash:month}
    {stash:month}November{/stash:month}
    {stash:month}October{/stash:month}
    {stash:month}September{/stash:month}
    {stash:month}August{/stash:month}
    {stash:month}July{/stash:month}
    {stash:month}June{/stash:month}
    {stash:month}May{/stash:month}
    {stash:month}April{/stash:month}
    {stash:month}March{/stash:month}
    {stash:month}February{/stash:month}
    {stash:month}January{/stash:month}
    {/exp:stash:set_list}

    {!-- put it all together --}
    {exp:stash:get_list name="years" unique="yes" orderby="date_year" sort="desc"}

    <h1>{date_year}</h1>

    {exp:stash:get_list:months name="months"}

    {exp:stash:get_list:entries
    name="entries"
    match="#^{date_year}-{month}$#"
    against="date_sort"
    orderby="date_machine"
    sort="desc"
    prefix="entry"
    }

    {if entry:count==1}
    <h2>{month}</h2>
    <ul>
    {/if}

    <li>{title} ({date_year}-{date_month}-{date_day})</li>

    {if entry:count==entry:total_results}
    </ul>
    {/if}
    {/exp:stash:get_list:entries}

    {/exp:stash:get_list:months}

    {/exp:stash:get_list}
    180 changes: 180 additions & 0 deletions entries_archive.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,180 @@
    {exp:stash:set_list name="entries" parse_tags="yes"}
    {exp:channel:entries channel="my_channel" orderby="date" sort="desc" dynamic="no" limit="999"}
    {stash:title}{title}{/stash:title}
    {stash:date_day}{entry_date format="%d"}{/stash:date_day}
    {stash:date_month}{entry_date format="%m"}{/stash:date_month}
    {stash:date_year}{entry_date format="%Y"}{/stash:date_year}
    {stash:date_sort}{entry_date format="%Y-%F"}{/stash:date_sort}
    {stash:date_machine}{entry_date}{/stash:date_machine}
    {/exp:channel:entries}
    {/exp:stash:set_list}

    {!-- make a copy containing only the years, so we can find all unique years--}
    {exp:stash:set_list name="years" parse_tags="yes"}
    {exp:stash:get_list name="entries"}
    {stash:date_year}{date_year}{/stash:date_year}
    {/exp:stash:get_list}
    {/exp:stash:set_list}

    {!-- make list of months in reverse order --}
    {exp:stash:set_list name="months"}
    {stash:month}December{/stash:month}
    {stash:month}November{/stash:month}
    {stash:month}October{/stash:month}
    {stash:month}September{/stash:month}
    {stash:month}August{/stash:month}
    {stash:month}July{/stash:month}
    {stash:month}June{/stash:month}
    {stash:month}May{/stash:month}
    {stash:month}April{/stash:month}
    {stash:month}March{/stash:month}
    {stash:month}February{/stash:month}
    {stash:month}January{/stash:month}
    {/exp:stash:set_list}

    {!-- put it all together --}
    {exp:stash:get_list name="years" unique="yes" orderby="date_year" sort="desc"}

    <h1>{date_year}</h1>

    {exp:stash:get_list:months name="months"}

    {exp:stash:get_list:entries
    name="entries"
    match="#^{date_year}-{month}$#"
    against="date_sort"
    orderby="date_machine"
    sort="desc"
    prefix="entry"
    }
    {if entry:count==1}
    <h2>{month}</h2>
    <ul>
    {/if}

    <li>{title} ({date_year}-{date_month}-{date_day})</li>

    {if entry:count==entry:total_results}
    </ul>
    {/if}
    {/exp:stash:get_list:entries}

    {/exp:stash:get_list:months}

    {/exp:stash:get_list}


    Example output:

    <h1>
    2013
    </h1>
    <h2>
    May
    </h2>
    <ul>
    <li> Vitra (2013-05-08) </li>
    <li> Victoria + Albert Baths (2013-05-08) </li>
    <li> Vado (2013-05-08) </li>
    <li> NotOnlyWhite (2013-05-08) </li>
    <li> Kaldewei (2013-05-08) </li>
    <li> Bisque (2013-05-01) </li>
    <li> Hansgrohe (2013-05-01) </li>
    <li> Majestic Showers (2013-05-01) </li>
    <li> Inda (2013-05-01) </li>
    <li> Grohe (2013-05-01) </li>
    <li> Fantini (2013-05-01) </li>
    </ul>
    <h2>
    April
    </h2>
    <ul>
    <li> Kanth (2013-04-12) </li>
    <li> Bette (2013-04-10)</li>
    </ul>
    <h2>
    February
    </h2>
    <ul>
    <li> PomD'or (2013-02-27) </li>
    <li> Vola (2013-02-27) </li>
    <li> Lefroy Brooks (2013-02-27) </li>
    <li> Laufen (2013-02-27) </li>
    <li> Falper (2013-02-27) </li>
    <li> Flaminia (2013-02-27) </li>
    <li> Dornbracht (2013-02-27) </li>
    <li> Bard &amp; Brazier (2013-02-27) </li>
    <li> Graff (2013-02-27) </li>
    <li> Ashton &amp; Bentley (2013-02-27) </li>
    <li> Agape (2013-02-27) </li>
    </ul>
    <h1>
    2013
    </h1>
    <h2>
    May
    </h2>
    <ul>
    <li> Vitra (2013-05-08) </li>
    <li> Victoria + Albert Baths (2013-05-08) </li>
    <li> Vado (2013-05-08) </li>
    <li> NotOnlyWhite (2013-05-08) </li>
    <li> Kaldewei (2013-05-08) </li>
    <li> Bisque (2013-05-01) </li>
    <li> Hansgrohe (2013-05-01) </li>
    <li> Majestic Showers (2013-05-01) </li>
    <li> Inda (2013-05-01) </li>
    <li> Grohe (2013-05-01) </li>
    <li> Fantini (2013-05-01) </li>
    </ul>
    <h2>
    April
    </h2>
    <ul>
    <li> Kanth (2013-04-12) </li>
    <li> Bette (2013-04-10) </li>
    </ul>
    <h2>
    February
    </h2>
    <ul>
    <li> PomD’or (2013-02-27) </li>
    <li> Vola (2013-02-27) </li>
    <li> Lefroy Brooks (2013-02-27) </li>
    <li> Laufen (2013-02-27) </li>
    <li> Falper (2013-02-27) </li>
    <li> Flaminia (2013-02-27) </li>
    <li> Dornbracht (2013-02-27) </li>
    <li> Bard &amp; Brazier (2013-02-27) </li>
    <li> Graff (2013-02-27) </li>
    <li> Ashton &amp; Bentley (2013-02-27) </li>
    <li> Agape (2013-02-27) </li>
    </ul>

    <h1>
    2012
    </h1>
    <h2>
    December
    </h2>
    <ul>
    <li> Vitra (2012-12-08) </li>
    <li> Victoria + Albert Baths (2012-12-08) </li>
    <li> Vado (2012-12-08) </li>
    <li> NotOnlyWhite (2012-12-08) </li>
    <li> Kaldewei (2012-12-08) </li>
    <li> Bisque (2012-12-01) </li>
    <li> Hansgrohe (2012-12-01) </li>
    <li> Majestic Showers (2012-12-01) </li>
    <li> Inda (2012-12-01) </li>
    <li> Grohe (2012-12-01) </li>
    <li> Fantini (2012-12-01) </li>
    </ul>
    <h2>
    April
    </h2>
    <ul>
    <li> Kanth (2012-04-12) </li>
    <li> Bette (2012-04-10)</li>
    </ul>
  4. @croxton croxton revised this gist Aug 13, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion entries_archive
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    {exp:stash:set_list name="entries" parse_tags="yes"}
    {exp:channel:entries channel="brands" orderby="date" sort="desc" dynamic="no" limit="999"}
    {exp:channel:entries channel="my_channel" orderby="date" sort="desc" dynamic="no" limit="999"}
    {stash:title}{title}{/stash:title}
    {stash:date_day}{entry_date format="%d"}{/stash:date_day}
    {stash:date_month}{entry_date format="%m"}{/stash:date_month}
  5. @croxton croxton revised this gist Aug 13, 2013. 1 changed file with 55 additions and 55 deletions.
    110 changes: 55 additions & 55 deletions entries_archive
    Original file line number Diff line number Diff line change
    @@ -1,65 +1,65 @@
    {exp:stash:set_list name="entries" parse_tags="yes"}
    {exp:channel:entries channel="brands" orderby="date" sort="desc" dynamic="no" limit="999"}
    {stash:title}{title}{/stash:title}
    {stash:date_day}{entry_date format="%d"}{/stash:date_day}
    {stash:date_month}{entry_date format="%m"}{/stash:date_month}
    {stash:date_year}{entry_date format="%Y"}{/stash:date_year}
    {stash:date_sort}{entry_date format="%Y-%F"}{/stash:date_sort}
    {stash:date_machine}{entry_date}{/stash:date_machine}
    {/exp:channel:entries}
    {/exp:stash:set_list}
    {exp:stash:set_list name="entries" parse_tags="yes"}
    {exp:channel:entries channel="brands" orderby="date" sort="desc" dynamic="no" limit="999"}
    {stash:title}{title}{/stash:title}
    {stash:date_day}{entry_date format="%d"}{/stash:date_day}
    {stash:date_month}{entry_date format="%m"}{/stash:date_month}
    {stash:date_year}{entry_date format="%Y"}{/stash:date_year}
    {stash:date_sort}{entry_date format="%Y-%F"}{/stash:date_sort}
    {stash:date_machine}{entry_date}{/stash:date_machine}
    {/exp:channel:entries}
    {/exp:stash:set_list}

    {!-- make a copy containing only the years, so we can find all unique years--}
    {exp:stash:set_list name="years" parse_tags="yes"}
    {exp:stash:get_list name="entries"}
    {stash:date_year}{date_year}{/stash:date_year}
    {/exp:stash:get_list}
    {/exp:stash:set_list}
    {!-- make a copy containing only the years, so we can find all unique years--}
    {exp:stash:set_list name="years" parse_tags="yes"}
    {exp:stash:get_list name="entries"}
    {stash:date_year}{date_year}{/stash:date_year}
    {/exp:stash:get_list}
    {/exp:stash:set_list}

    {!-- make list of months in reverse order --}
    {exp:stash:set_list name="months"}
    {stash:month}December{/stash:month}
    {stash:month}November{/stash:month}
    {stash:month}October{/stash:month}
    {stash:month}September{/stash:month}
    {stash:month}August{/stash:month}
    {stash:month}July{/stash:month}
    {stash:month}June{/stash:month}
    {stash:month}May{/stash:month}
    {stash:month}April{/stash:month}
    {stash:month}March{/stash:month}
    {stash:month}February{/stash:month}
    {stash:month}January{/stash:month}
    {/exp:stash:set_list}
    {!-- make list of months in reverse order --}
    {exp:stash:set_list name="months"}
    {stash:month}December{/stash:month}
    {stash:month}November{/stash:month}
    {stash:month}October{/stash:month}
    {stash:month}September{/stash:month}
    {stash:month}August{/stash:month}
    {stash:month}July{/stash:month}
    {stash:month}June{/stash:month}
    {stash:month}May{/stash:month}
    {stash:month}April{/stash:month}
    {stash:month}March{/stash:month}
    {stash:month}February{/stash:month}
    {stash:month}January{/stash:month}
    {/exp:stash:set_list}

    {!-- put it all together --}
    {exp:stash:get_list name="years" unique="yes" orderby="date_year" sort="desc"}
    {!-- put it all together --}
    {exp:stash:get_list name="years" unique="yes" orderby="date_year" sort="desc"}

    <h1>{date_year}</h1>
    <h1>{date_year}</h1>

    {exp:stash:get_list:months name="months"}
    {exp:stash:get_list:months name="months"}

    {exp:stash:get_list:entries
    name="entries"
    match="#^{date_year}-{month}$#"
    against="date_sort"
    orderby="date_machine"
    sort="desc"
    prefix="entry"
    }
    {if entry:count==1}
    <h2>{month}</h2>
    <ul>
    {/if}
    {exp:stash:get_list:entries
    name="entries"
    match="#^{date_year}-{month}$#"
    against="date_sort"
    orderby="date_machine"
    sort="desc"
    prefix="entry"
    }

    {if entry:count==1}
    <h2>{month}</h2>
    <ul>
    {/if}

    <li>{title} ({date_year}-{date_month}-{date_day})</li>
    <li>{title} ({date_year}-{date_month}-{date_day})</li>

    {if entry:count==entry:total_results}
    </ul>
    {/if}
    {/exp:stash:get_list:entries}
    {if entry:count==entry:total_results}
    </ul>
    {/if}
    {/exp:stash:get_list:entries}

    {/exp:stash:get_list:months}
    {/exp:stash:get_list:months}

    {/exp:stash:get_list}
    {/exp:stash:get_list}
  6. @croxton croxton created this gist Aug 13, 2013.
    65 changes: 65 additions & 0 deletions entries_archive
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,65 @@
    {exp:stash:set_list name="entries" parse_tags="yes"}
    {exp:channel:entries channel="brands" orderby="date" sort="desc" dynamic="no" limit="999"}
    {stash:title}{title}{/stash:title}
    {stash:date_day}{entry_date format="%d"}{/stash:date_day}
    {stash:date_month}{entry_date format="%m"}{/stash:date_month}
    {stash:date_year}{entry_date format="%Y"}{/stash:date_year}
    {stash:date_sort}{entry_date format="%Y-%F"}{/stash:date_sort}
    {stash:date_machine}{entry_date}{/stash:date_machine}
    {/exp:channel:entries}
    {/exp:stash:set_list}

    {!-- make a copy containing only the years, so we can find all unique years--}
    {exp:stash:set_list name="years" parse_tags="yes"}
    {exp:stash:get_list name="entries"}
    {stash:date_year}{date_year}{/stash:date_year}
    {/exp:stash:get_list}
    {/exp:stash:set_list}

    {!-- make list of months in reverse order --}
    {exp:stash:set_list name="months"}
    {stash:month}December{/stash:month}
    {stash:month}November{/stash:month}
    {stash:month}October{/stash:month}
    {stash:month}September{/stash:month}
    {stash:month}August{/stash:month}
    {stash:month}July{/stash:month}
    {stash:month}June{/stash:month}
    {stash:month}May{/stash:month}
    {stash:month}April{/stash:month}
    {stash:month}March{/stash:month}
    {stash:month}February{/stash:month}
    {stash:month}January{/stash:month}
    {/exp:stash:set_list}

    {!-- put it all together --}
    {exp:stash:get_list name="years" unique="yes" orderby="date_year" sort="desc"}

    <h1>{date_year}</h1>

    {exp:stash:get_list:months name="months"}

    {exp:stash:get_list:entries
    name="entries"
    match="#^{date_year}-{month}$#"
    against="date_sort"
    orderby="date_machine"
    sort="desc"
    prefix="entry"
    }

    {if entry:count==1}
    <h2>{month}</h2>
    <ul>
    {/if}

    <li>{title} ({date_year}-{date_month}-{date_day})</li>

    {if entry:count==entry:total_results}
    </ul>
    {/if}
    {/exp:stash:get_list:entries}

    {/exp:stash:get_list:months}

    {/exp:stash:get_list}