sprint 8 ‐ server‐side rendering ‐ week 2 - julia-stevens/i-love-web GitHub Wiki

Sprint 8 - Server-side Rendering

Week 2

woensdag 12 maart 2025

👉 Experiment 1: Ik wil alle studenten gesorteerd op name

https://fdnd.directus.app/items/person?fields=name&sort=name

👉 Experiment 2: Ik wil alle names van studenten die een name hebben die begint met de letter D

https://fdnd.directus.app/items/person?fields=name&filter[name][_starts_with]=D

👉 Experiment 3: Ik wil alle names van studenten die een name hebben die begint met de letter D of K

https://fdnd.directus.app/items/person?fields=name&filter[_or][0][name][_starts_with]=D&filter[_or][1][name][_starts_with]=K

👉 Experiment 4: Ik wil alle names en birthdates van studenten die een birthdate hebben ingevuld

https://fdnd.directus.app/items/person?fields=name,birthdate&filter[birthdate][_nnull]

👉 Experiment 5: Ik wil alle names en birthdates van studenten met een birthdate in 2002

https://fdnd.directus.app/items/person?fields=name,birthdate&filter[year(birthdate)][_eq]=2002

👉 Experiment 6: Haal een lijst van alle unieke fav_tag op, en laat zien hoeveel mensen die tag hebben

https://fdnd.directus.app/items/person?fields=fav_tag&filter[fav_tag][_neq]=null&aggregate[count]=fav_tag&groupBy=fav_tag

liquid filters

concat

Concatenates (joins together) multiple arrays. The resulting array contains all the items from the input arrays.

{% assign fruits = "apples, oranges, peaches" | split: ", " %}
{% assign vegetables = "carrots, turnips, potatoes" | split: ", " %}

{% assign everything = fruits | concat: vegetables %}

{% for item in everything %}
- {{ item }}
{% endfor %}
  • apples
  • oranges
  • peaches
  • carrots
  • turnips
  • potatoes

floor

Rounds an input down to the nearest whole number. Liquid tries to convert the input to a number before the filter is applied.

{{ 1.2 | floor }}
{{ 2.0 | floor }}
{{ 183.357 | floor }}

1 2 183

escape

Escapes a string by replacing characters with escape sequences (so that the string can be used in a URL, for example). It doesn’t change strings that don’t have anything to escape.

{{ "Have you read 'James & the Giant Peach'?" | escape }}

Have you read 'James & the Giant Peach'?

default

Sets a default value for any variable with no assigned value. default will show its value if the input is nil, false, or empty. <title>{{ pageTitle | default: "Oncollaboration" }}</title>

strip_html

Removes any HTML tags from a string. <p>{{ webinar.description | strip_html }}</p>

⚠️ **GitHub.com Fallback** ⚠️