<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP &#8211; flurin&#039;s lernjournal</title>
	<atom:link href="https://flurin-lernjournal.hosttech.ch/category/lernjournal/hosttech/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://flurin-lernjournal.hosttech.ch</link>
	<description></description>
	<lastBuildDate>Fri, 23 Oct 2026 13:05:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2024/08/Nature-11-150x150.jpg</url>
	<title>PHP &#8211; flurin&#039;s lernjournal</title>
	<link>https://flurin-lernjournal.hosttech.ch</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Statamic Google-Ads pages comparison</title>
		<link>https://flurin-lernjournal.hosttech.ch/statamic-google-ads-pages-comparison/</link>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Wed, 29 Jul 2026 09:21:33 +0000</pubDate>
				<category><![CDATA[Erklärungen]]></category>
		<category><![CDATA[hosttech]]></category>
		<category><![CDATA[Lernjournal]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://flurin-lernjournal.hosttech.ch/?p=1604</guid>

					<description><![CDATA[This is a comparison between my Statamic project and the one that Manuel and Cedric did which is live. For simplicity&#8217;s sake i will reference them as &#8220;my project&#8221; and &#8220;live project&#8221;. Statamic Comparison of the Live Statamic Project and My Project Overall architecture Both projects follow the same core architecture. They use a Replicator [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="has-small-font-size wp-block-paragraph">This is a comparison between my Statamic project and the one that Manuel and Cedric did which is live. For simplicity&#8217;s sake i will reference them as &#8220;my project&#8221; and &#8220;live project&#8221;.  </p>



<h3 class="wp-block-heading has-large-font-size">Statamic Comparison of the Live Statamic Project and My Project</h3>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Overall architecture</h2>



<p class="has-small-font-size wp-block-paragraph">Both projects follow the same core architecture. They use a Replicator to build pages from independent content sections and separate page content, reusable offers, blueprints, fieldsets, and frontend templates. Both also keep offers in their own collection instead of embedding product information directly into the landing page, and each section is rendered through its own Antlers partial.</p>



<p class="has-small-font-size wp-block-paragraph">The main difference is that the Live project uses a generic Page blueprint with a flexible page builder, making it reusable for different landing pages. My project uses a dedicated Webhosting blueprint with a fixed set of section types, making it more specific to a single landing page.</p>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Page sections</h2>



<p class="has-small-font-size wp-block-paragraph">My project provides six predefined section types:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Information</li>



<li class="has-small-font-size">Company</li>



<li class="has-small-font-size">Selected Offers</li>



<li class="has-small-font-size">Trust Reason</li>



<li class="has-small-font-size">Contact</li>



<li class="has-small-font-size">Comments</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">The Live project provides a much larger collection of reusable builder blocks:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Hero</li>



<li class="has-small-font-size">Certificate</li>



<li class="has-small-font-size">Plans Table</li>



<li class="has-small-font-size">Feature Grid</li>



<li class="has-small-font-size">Standalone CTA</li>



<li class="has-small-font-size">Split Section</li>



<li class="has-small-font-size">Testimonials</li>



<li class="has-small-font-size">Logo Cloud</li>



<li class="has-small-font-size">Support Card</li>



<li class="has-small-font-size">FAQ</li>



<li class="has-small-font-size">Spacer</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">Because of this, the Live project can build much more complex landing pages without introducing additional blueprints.</p>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">CTA implementation</h2>



<p class="has-small-font-size wp-block-paragraph">My project stores CTA fields directly inside multiple sections, usually as separate fields for the button label and destination link. These fields are duplicated across sections such as Information, Trust Reason, Contact, and Offers.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project extracts the common button fields into a reusable CTA fieldset. This fieldset is reused by multiple builder components, while individual components can extend it with additional options such as button size, visual variants, icons, or descriptions. This reduces duplicated field definitions while remaining flexible.</p>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Features</h2>



<p class="has-small-font-size wp-block-paragraph">The two projects model features differently.</p>



<p class="has-small-font-size wp-block-paragraph">My project imports a reusable Features fieldset, which contains repeatable feature items along with layout and styling options.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project does not use a separate Features fieldset. Instead, the Feature Grid builder defines its own feature structure directly within the builder. Each feature contains its own title, description, and icon, making the entire structure self-contained.</p>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Testimonials / Comments</h2>



<p class="has-small-font-size wp-block-paragraph">The testimonial sections are conceptually very similar in both projects. Both store review text, star ratings, reviewer information, and profile images before rendering responsive testimonial cards.</p>



<p class="has-small-font-size wp-block-paragraph">The main structural difference is how reviewer information is organised.</p>



<p class="has-small-font-size wp-block-paragraph">My project stores the reviewer name, profile image, star rating, and comment together inside each testimonial entry.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project separates the reviewer information into a dedicated author group, keeping author metadata separate from the testimonial content.</p>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Company / Certificate section</h2>



<p class="has-small-font-size wp-block-paragraph">Both projects include a section dedicated to trust signals such as star ratings, reviewer information, and certification imagery.</p>



<p class="has-small-font-size wp-block-paragraph">My project stores the star rating and reviewer links together through the shared Stars fieldset.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project separates these responsibilities. The rating is stored through a reusable Rating fieldset, while tester or reviewer links are stored in their own repeatable Grid. This creates a clearer separation between the rating itself and the reviewer data.</p>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Offer implementation</h2>



<p class="has-small-font-size wp-block-paragraph">Both projects separate product information into a dedicated Offers collection.</p>



<p class="has-small-font-size wp-block-paragraph">My project stores offer features as Markdown alongside pricing, discount information, currency, duration, and CTA fields.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project organises offer data into logical groups. Pricing is stored in a Billing Information group, the CTA is stored in its own group, and product features are stored as a structured Grid containing a value and description for each feature. This creates a more structured data model and makes feature information easier to display consistently.</p>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Offer selection</h2>



<p class="has-small-font-size wp-block-paragraph">Both projects allow landing pages to display products from the Offers collection, but they differ in how products are selected.</p>



<p class="has-small-font-size wp-block-paragraph">My project provides an interface for selecting specific offers, but the frontend ignores those selections and instead displays all available offers sorted by price.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project uses an Entries field that respects both the selected offers and the order chosen by the editor, giving complete editorial control over which products appear on the page.</p>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Fieldsets</h2>



<p class="has-small-font-size wp-block-paragraph">Both projects make use of reusable fieldsets, although they focus on different areas.</p>



<p class="has-small-font-size wp-block-paragraph">My project includes reusable fieldsets for:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Features</li>



<li class="has-small-font-size">Stars</li>



<li class="has-small-font-size">Contact Card</li>



<li class="has-small-font-size">Support Card</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">The Features fieldset is reused across multiple landing pages.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project keeps its fieldsets smaller and more focused by primarily reusing:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">CTA Button</li>



<li class="has-small-font-size">Rating Stars</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">Rather than extracting larger page structures into fieldsets, the Live project defines more complex content directly inside builder components.</p>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Support section</h2>



<p class="has-small-font-size wp-block-paragraph"><strong>My project</strong> imports its contact content from a reusable Contact Card fieldset. A wrapper template applies page-specific styling while the content remains fully editable through the CMS.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project includes a Support Card builder that contains no editable fields. The text, checklist, images, and button are hardcoded inside the template, allowing editors only to control where the component appears within the page.</p>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">FAQ</h2>



<p class="has-small-font-size wp-block-paragraph">My project does not include a dedicated FAQ section.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project introduces a dedicated FAQ builder containing editable questions and Markdown answers. Accordion behaviour is handled through Livewire, allowing questions to expand and collapse without requiring a page reload.</p>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Layout and rendering</h2>



<p class="has-small-font-size wp-block-paragraph">Both projects render pages dynamically using Replicator content and Antlers partials.</p>



<p class="has-small-font-size wp-block-paragraph">My project renders the page in two passes, first displaying the dark sections and then rendering the remaining light sections before loading the appropriate partial based on the Replicator type.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project loops through a generic page builder and dispatches each builder block directly to its corresponding component. This creates a more reusable rendering pipeline that can easily support additional builder components.</p>



<h2 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Notable implementation differences</h2>



<p class="wp-block-paragraph">Some additional implementation differences include:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">My project stores offer features as Markdown, while the Live project stores them as a structured Grid.</li>



<li class="has-small-font-size">My project uses a reusable Features fieldset, while the Live project defines feature structures directly within the Feature Grid builder.</li>



<li class="has-small-font-size">The Live project introduces a reusable CTA fieldset instead of duplicating CTA fields across multiple sections as My project does.</li>



<li class="has-small-font-size">The Live project groups reviewer information separately from testimonial content, whereas My project stores all reviewer data directly inside each testimonial.</li>



<li class="has-small-font-size">The Live project respects manually selected and ordered offers, whereas My project automatically displays all available offers sorted by price.</li>



<li class="has-small-font-size">The Live project introduces Livewire to provide interactive FAQ functionality, while My project does not include a dedicated FAQ section.</li>



<li class="has-small-font-size">The Live project is centred around a reusable page builder capable of supporting multiple landing pages, whereas My project is more closely tailored to a specific Google Ads Webhosting page.</li>
</ul>



<h2 class="wp-block-heading has-large-font-size">Code Comparison of the Live Statamic Project and My Project</h2>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Overall architecture</h3>



<p class="has-small-font-size wp-block-paragraph">Both projects follow the same general concept. A Statamic entry acts as the landing page, while a Replicator determines which sections are rendered. Each section is displayed through its own Antlers partial, meaning the page itself primarily controls composition while the individual partials handle presentation.</p>



<p class="has-small-font-size wp-block-paragraph">The primary architectural difference is how the page is rendered.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project uses a generic <code>builder</code> Replicator inside a reusable Page blueprint. The main layout loops through every builder block and explicitly checks its type before rendering the matching component.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ builder }}
    {{ if type == "hero_section" }}
        {{ partial:components/builder/hero_section }}
    {{ /if }}

    {{ if type == "plans_table" }}
        {{ partial:components/builder/plans_table }}
    {{ /if }}
{{ /builder }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> builder </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> type </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">hero_section</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">builder</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">hero_section </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> type </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">plans_table</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">builder</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">plans_table </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">builder </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Because the builder itself determines the page structure, sections are rendered exactly in the order stored within the Control Panel.</p>



<p class="has-small-font-size wp-block-paragraph">My project instead stores its content inside the <code>page_sections</code> Replicator. Rather than checking every possible section type individually, it dynamically loads the matching partial using the Replicator&#8217;s type.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ partial src="sections/google_ads/webhosting/{type}" }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">sections/google_ads/webhosting/{type}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This naming convention keeps the page template much smaller, since adding a new section only requires creating a matching partial.</p>



<p class="has-small-font-size wp-block-paragraph">Another important difference is that My project renders the page in two separate passes:</p>



<ol class="wp-block-list">
<li class="has-small-font-size">Information, Company, and Selected Offers</li>



<li class="has-small-font-size">All remaining sections</li>
</ol>



<p class="has-small-font-size wp-block-paragraph">Although editors can reorder sections inside each group, these two rendering passes always place the first three section types above the remaining ones. The Live project does not have this limitation because it renders sections directly from the stored builder order.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Layout and builder dispatch</h3>



<p class="has-small-font-size wp-block-paragraph">Both projects rely on Antlers partials to render individual sections, but they dispatch those sections differently.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The layout acts as the central dispatcher. Every builder type is checked individually before loading the corresponding partial.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ if type == "hero_section" }}
    {{ partial:components/builder/hero_section }}
{{ /if }}

{{ if type == "plans_table" }}
    {{ partial:components/builder/plans_table }}
{{ /if }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> type </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">hero_section</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">builder</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">hero_section </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> type </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">plans_table</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">builder</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">plans_table </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This makes every supported builder block explicit within the layout. Adding a completely new builder type requires updating both the blueprint and the layout to recognise the new block.</p>



<p class="has-small-font-size wp-block-paragraph">Unknown builder types simply render nothing.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">My project uses a dynamic partial path instead.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ partial src="sections/google_ads/webhosting/{type}" }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">sections/google_ads/webhosting/{type}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">As long as a Replicator set has a corresponding Antlers partial with the same name, Statamic automatically loads the correct template. This approach removes the need to maintain multiple conditional statements inside the page template.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Enabled state and ordering</h3>



<p class="has-small-font-size wp-block-paragraph">Both projects rely on Statamic&#8217;s built-in Replicator ordering and enabled state.</p>



<p class="has-small-font-size wp-block-paragraph">Neither project performs additional sorting on builder sections or nested Replicators. Instead, items are rendered in the same order that editors arrange them inside the Control Panel.</p>



<p class="has-small-font-size wp-block-paragraph">The main difference is how the page itself is processed.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project preserves the exact order of every builder block because it loops directly over the stored <code>builder</code> field.</p>



<p class="has-small-font-size wp-block-paragraph">My project preserves the order only within its two rendering groups, since the template intentionally separates the hero area from the remaining content before rendering.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Asset handling</h3>



<p class="has-small-font-size wp-block-paragraph">Both projects make extensive use of Statamic asset fields but retrieve image URLs differently.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The Live project primarily relies on Statamic&#8217;s <strong>asset augmentation</strong>. Printing an asset field automatically resolves the asset URL, while additional metadata is accessed using sub-properties.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;img src="{{ right:image }}" alt="{{ right:image:alt }}"></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ right:image }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ right:image:alt }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">For multiple assets, each item exposes its own URL and alt text.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ logos }}
    &lt;img src="{{ url }}" alt="{{ alt }}">
{{ /logos }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> logos </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ alt }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">logos </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This makes the templates relatively compact because the augmentation process automatically resolves the required asset information.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">My project instead relies heavily on <strong>Glide</strong> when rendering images.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ if certificates }}
    &lt;img src="{{ glide:certificates }}" alt="{{ certificates:alt }}">
{{ /if }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> certificates </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ glide:certificates }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ certificates:alt }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Using Glide allows Statamic to generate processed image URLs while still exposing asset metadata through the normal asset field.</p>



<p class="has-small-font-size wp-block-paragraph">Both approaches achieve similar results, although the Live project generally outputs augmented asset URLs directly, whereas My project explicitly processes many images through Glide before rendering them.</p>



<p class="has-small-font-size wp-block-paragraph">In both projects, decorative assets such as blur backgrounds remain hardcoded inside the templates rather than being editable through the CMS.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Hero / Information section</h3>



<p class="has-small-font-size wp-block-paragraph">The Hero section serves the same overall purpose in both projects but differs significantly in how content is modelled.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Content structure</h3>



<p class="has-small-font-size wp-block-paragraph">My project uses a relatively flat structure containing dedicated fields for:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Headline</li>



<li class="has-small-font-size">Subheadline</li>



<li class="has-small-font-size">Bullet points</li>



<li class="has-small-font-size">Offer price</li>



<li class="has-small-font-size">Special offer text</li>



<li class="has-small-font-size">CTA text</li>



<li class="has-small-font-size">CTA link</li>



<li class="has-small-font-size">Background image</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">Bullet points are stored in a Grid.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ bullet_points }}
    &lt;li>{{ text }}&lt;/li>
{{ /bullet_points }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> bullet_points </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> text </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">bullet_points </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Optional values such as prices and buttons are wrapped in conditional statements before being rendered.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ if offer_price }}
    &lt;p>ab {{ offer_price }} / Monat&lt;/p>
{{ /if }}

{{ if cta_text }}
    &lt;a href="{{ cta_link }}">{{ cta_text }}&lt;/a>
{{ /if }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> offer_price </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">ab </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> offer_price </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF"> Monat</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> cta_text </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ cta_link }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> cta_text </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Nested content system</h3>



<p class="has-small-font-size wp-block-paragraph">The Live project takes a much more flexible approach.</p>



<p class="has-small-font-size wp-block-paragraph">Instead of storing fixed hero fields, the left side of the Hero contains a nested Replicator called <code>content</code>. Editors can freely arrange different block types, including:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Heading</li>



<li class="has-small-font-size">Markdown text</li>



<li class="has-small-font-size">Checklist</li>



<li class="has-small-font-size">CTA button</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">The template renders different markup depending on each nested block&#8217;s type.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ left:content }}
    {{ if type == "heading" }}
        &lt;h2>{{ heading }}&lt;/h2>
    {{ /if }}

    {{ if type == "text" }}
        {{ text | markdown }}
    {{ /if }}

    {{ if type == "checklist" }}
        {{ checklist }}
            &lt;strong>{{ label }}&lt;/strong> {{ value }}
        {{ /checklist }}
    {{ /if }}
{{ /left:content }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> left</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">content </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> type </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">heading</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h2</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> heading </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h2</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> type </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> text </span><span style="color: #81A1C1">|</span><span style="color: #D8DEE9FF"> markdown </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> type </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">checklist</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> checklist </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">strong</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> label </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">strong</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> value </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">checklist </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">left</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">content </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This makes the Hero considerably more flexible because editors are no longer restricted to a predefined sequence of heading, text, checklist, and button.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">CTA implementation inside the Hero</h3>



<p class="has-small-font-size wp-block-paragraph">Another implementation difference is how the Hero button is handled.</p>



<p class="has-small-font-size wp-block-paragraph">My project stores the button directly as two fields:</p>



<ul class="wp-block-list">
<li class="has-small-font-size"><code>cta_text</code></li>



<li class="has-small-font-size"><code>cta_link</code></li>
</ul>



<p class="has-small-font-size wp-block-paragraph">The template outputs a standard anchor element whenever button text exists.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ if cta_text }}
    &lt;a href="{{ cta_link }}">{{ cta_text }}&lt;/a>
{{ /if }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> cta_text </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ cta_link }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> cta_text </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The Live project imports the shared CTA fieldset instead. The Hero automatically forces the button to use the shared button component with predefined styling, while optionally displaying an icon and descriptive text underneath the button when a description has been entered.</p>



<p class="has-small-font-size wp-block-paragraph">This keeps Hero buttons visually consistent with buttons used throughout the rest of the project.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Markdown support</h3>



<p class="has-small-font-size wp-block-paragraph">The Hero sections also differ in how text content is stored.</p>



<p class="has-small-font-size wp-block-paragraph">My project stores separate headline and subheadline values as plain text.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project stores text blocks as Markdown and converts them during rendering.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ text | markdown }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> text </span><span style="color: #81A1C1">|</span><span style="color: #D8DEE9FF"> markdown </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This allows editors to apply formatting inside the CMS while keeping the rendering logic relatively simple.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Background imagery</h3>



<p class="has-small-font-size wp-block-paragraph">Both projects use editor-selected images for the Hero, but the implementation differs.</p>



<p class="has-small-font-size wp-block-paragraph">My project renders the background image separately from the section itself. The main page template searches for the Information section and places its image inside a shared background layer.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project stores the Hero image directly as part of the Hero builder block, while decorative blur images remain fixed within the template.</p>



<p class="has-small-font-size wp-block-paragraph">This keeps editable content and decorative design assets clearly separated.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Offers implementation</h3>



<p class="has-small-font-size wp-block-paragraph">Both projects separate product information into a dedicated Offers collection, preventing pricing and feature information from being duplicated across landing pages. The implementation of the offer data, however, differs considerably.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Offer structure</h3>



<p class="has-small-font-size wp-block-paragraph">My project stores offer information in a relatively flat blueprint. Each offer contains fields such as:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Offer price</li>



<li class="has-small-font-size">Discounted price</li>



<li class="has-small-font-size">Discount end date</li>



<li class="has-small-font-size">Currency</li>



<li class="has-small-font-size">Duration</li>



<li class="has-small-font-size">Quote</li>



<li class="has-small-font-size">CTA text and link</li>



<li class="has-small-font-size">Markdown features</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">A typical offer is stored as:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">Markdown</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>title: Hosting L
offer_price: '12.90'
discount_offer_price: '9.90'
discount_date: '2026-06-10'
currency: CHF
duration: Mo.
cta_text: Top-Paket wählen
features: |-
  - **150 GB** Speicherplatz
  - **100% SSD** Turbo-Hosting</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">title: Hosting L</span></span>
<span class="line"><span style="color: #D8DEE9FF">offer_price: &#39;12.90&#39;</span></span>
<span class="line"><span style="color: #D8DEE9FF">discount_offer_price: &#39;9.90&#39;</span></span>
<span class="line"><span style="color: #D8DEE9FF">discount_date: &#39;2026-06-10&#39;</span></span>
<span class="line"><span style="color: #D8DEE9FF">currency: CHF</span></span>
<span class="line"><span style="color: #D8DEE9FF">duration: Mo.</span></span>
<span class="line"><span style="color: #D8DEE9FF">cta_text: Top-Paket wählen</span></span>
<span class="line"><span style="color: #D8DEE9FF">features: |-</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #ECEFF4">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4; font-weight: bold">**</span><span style="color: #D8DEE9FF; font-weight: bold">150 GB</span><span style="color: #ECEFF4; font-weight: bold">**</span><span style="color: #D8DEE9FF"> Speicherplatz</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #ECEFF4">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4; font-weight: bold">**</span><span style="color: #D8DEE9FF; font-weight: bold">100% SSD</span><span style="color: #ECEFF4; font-weight: bold">**</span><span style="color: #D8DEE9FF"> Turbo-Hosting</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The Markdown field is converted into HTML, allowing editors to create feature lists using simple Markdown syntax rather than a structured data model.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project groups related values together inside the blueprint.</p>



<p class="has-small-font-size wp-block-paragraph">Offer information is divided into:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Billing Information</li>



<li class="has-small-font-size">CTA</li>



<li class="has-small-font-size">Features Grid</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">A typical offer is stored like this:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">Markdown</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>title: 'Hosting L'
billing_information:
  regular_price: 12.9
  sale_price: 9.9
  sale_expiration_date: '2026-10-31'
  billing_period: monthly

category: webhosting</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">title: &#39;Hosting L&#39;</span></span>
<span class="line"><span style="color: #D8DEE9FF">billing_information:</span></span>
<span class="line"><span style="color: #D8DEE9FF">  regular_price: 12.9</span></span>
<span class="line"><span style="color: #D8DEE9FF">  sale_price: 9.9</span></span>
<span class="line"><span style="color: #D8DEE9FF">  sale_expiration_date: &#39;2026-10-31&#39;</span></span>
<span class="line"><span style="color: #D8DEE9FF">  billing_period: monthly</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">category: webhosting</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Instead of storing features as Markdown, every feature becomes a structured Grid row containing a value and a description. This creates a more structured data model and makes it easier to display individual feature values consistently.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Offer selection</h3>



<p class="has-small-font-size wp-block-paragraph">One of the largest implementation differences appears in how landing pages retrieve their offers.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">The Webhosting blueprint contains an <code>offers</code> Grid intended to allow editors to select specific products.</p>



<p class="has-small-font-size wp-block-paragraph">However, the frontend ignores those selections completely.</p>



<p class="has-small-font-size wp-block-paragraph">Instead, every published offer is queried directly from the collection.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ collection:offers sort="offer_price:asc" }}
    &lt;h3>{{ title }}&lt;/h3>
    &lt;p>{{ offer_price }} {{ currency }} / {{ duration }}&lt;/p>
{{ /collection:offers }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> collection</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">offers sort</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">offer_price:asc</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h3</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h3</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> offer_price </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> currency </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> duration </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">collection</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">offers </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">As a result:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Every published offer is displayed.</li>



<li class="has-small-font-size">Cards are automatically sorted by price.</li>



<li class="has-small-font-size">The order chosen inside the editor has no effect.</li>



<li class="has-small-font-size">Publishing another Offer automatically adds it to the page.</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">Because <code>offer_price</code> is stored as text, numeric sorting may become unreliable when prices have different digit lengths.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The Live project takes a different approach.</p>



<p class="has-small-font-size wp-block-paragraph">The page stores references to specific Offer entries using an Entries field.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>offers:
  - 03bdd800-57f6-48cd-a2ab-e9469844154f
  - 34fdbb7a-0dac-47c0-9ac6-0f84d7440d70
  - e7ae286f-7ec7-4ad1-b794-4cbfaa7f4a78</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">offers:</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">03</span><span style="color: #D8DEE9FF">bdd800</span><span style="color: #81A1C1">-</span><span style="color: #B48EAD">57</span><span style="color: #D8DEE9FF">f6</span><span style="color: #81A1C1">-</span><span style="color: #B48EAD">48</span><span style="color: #D8DEE9FF">cd</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">a2ab</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">e9469844154f</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">34</span><span style="color: #D8DEE9FF">fdbb7a</span><span style="color: #81A1C1">-</span><span style="color: #B48EAD">0</span><span style="color: #D8DEE9FF">dac</span><span style="color: #81A1C1">-</span><span style="color: #B48EAD">47</span><span style="color: #D8DEE9FF">c0</span><span style="color: #81A1C1">-</span><span style="color: #B48EAD">9</span><span style="color: #D8DEE9FF">ac6</span><span style="color: #81A1C1">-</span><span style="color: #B48EAD">0</span><span style="color: #D8DEE9FF">f84d7440d70</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> e7ae286f</span><span style="color: #81A1C1">-</span><span style="color: #B48EAD">7</span><span style="color: #D8DEE9FF">ec7</span><span style="color: #81A1C1">-</span><span style="color: #B48EAD">4</span><span style="color: #D8DEE9FF">ad1</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">b794</span><span style="color: #81A1C1">-</span><span style="color: #B48EAD">4</span><span style="color: #D8DEE9FF">cbfaa7f4a78</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The template simply loops over those selected entries.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ offers }}
    ...
{{ /offers }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> offers </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">...</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">offers </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This means:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Editors choose exactly which offers appear.</li>



<li class="has-small-font-size">Editors control the display order.</li>



<li class="has-small-font-size">No automatic collection query is performed.</li>



<li class="has-small-font-size">No additional sorting logic is required.</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">This implementation gives complete editorial control over the pricing table.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Discount handling</h3>



<p class="has-small-font-size wp-block-paragraph">Both projects support discounted pricing, but the implementation differs slightly.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">A card becomes a promotional offer whenever a discounted price exists.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ if discount_offer_price }}
    &lt;p>Aktion bis {{ discount_date format="d.m.Y" }}&lt;/p>
    &lt;s>{{ offer_price }}&lt;/s>
    &lt;strong>{{ discount_offer_price }}&lt;/strong>
{{ else }}
    &lt;strong>{{ offer_price }}&lt;/strong>
{{ /if }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> discount_offer_price </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">Aktion bis </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> discount_date format</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">d.m.Y</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">s</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> offer_price </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">s</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">strong</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> discount_offer_price </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">strong</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">strong</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> offer_price </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">strong</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The template formats the promotion banner and crossed-out regular price whenever a discount exists.</p>



<p class="has-small-font-size wp-block-paragraph">The discount end date is only displayed it is not checked to determine whether the promotion has expired.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The Live project calculates promotion status slightly differently.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ has_sale = billing_information:sale_price > 0 }}

{{ if has_sale }}
    {{ billing_information:sale_price }}
{{ else }}
    {{ billing_information:regular_price }}
{{ /if }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> has_sale </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> billing_information</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">sale_price </span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">0</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> has_sale </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> billing_information</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">sale_price </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> billing_information</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">regular_price </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Promotion styling depends entirely on whether the sale price is greater than zero.</p>



<p class="has-small-font-size wp-block-paragraph">When a sale exists, the pricing card:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Displays a promotion banner.</li>



<li class="has-small-font-size">Formats the expiration date.</li>



<li class="has-small-font-size">Crosses out the regular price.</li>



<li class="has-small-font-size">Switches the CTA to the primary style.</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">Like My project, the expiration date itself is not validated before displaying the promotion.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Features</h3>



<p class="has-small-font-size wp-block-paragraph">The projects model offer features very differently.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">Offer features are stored as Markdown.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">Markdown</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>- **150 GB** Speicherplatz
- **100% SSD** Turbo-Hosting</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4; font-weight: bold">**</span><span style="color: #D8DEE9FF; font-weight: bold">150 GB</span><span style="color: #ECEFF4; font-weight: bold">**</span><span style="color: #D8DEE9FF"> Speicherplatz</span></span>
<span class="line"><span style="color: #ECEFF4">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4; font-weight: bold">**</span><span style="color: #D8DEE9FF; font-weight: bold">100% SSD</span><span style="color: #ECEFF4; font-weight: bold">**</span><span style="color: #D8DEE9FF"> Turbo-Hosting</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Statamic converts the Markdown into HTML before the template applies styling.</p>



<p class="has-small-font-size wp-block-paragraph">This keeps the blueprint very simple while giving editors some formatting flexibility.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The Live project stores every feature as structured data.</p>



<p class="has-small-font-size wp-block-paragraph">Each Grid row contains:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">value</li>



<li class="has-small-font-size">description</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">The template renders both values independently.</p>



<p class="has-small-font-size wp-block-paragraph">This approach removes the need to parse Markdown and makes individual values much easier to style consistently.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Feature sections</h3>



<p class="has-small-font-size wp-block-paragraph">The landing page feature sections also differ considerably.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">The Trust Reason section imports the reusable Features fieldset.</p>



<p class="has-small-font-size wp-block-paragraph">Each feature is stored inside a nested Replicator.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ feature }}
    &lt;article>
        &lt;img src="{{ glide:feature_image }}">
        &lt;h3>{{ feature_title }}&lt;/h3>
        &lt;p>{{ feature_description }}&lt;/p>
    &lt;/article>
{{ /feature }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> feature </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">article</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ glide:feature_image }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h3</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> feature_title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h3</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> feature_description </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">article</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">feature </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Although the fieldset provides settings such as:</p>



<ul class="wp-block-list">
<li class="has-small-font-size"><code>columns_amount</code></li>



<li class="has-small-font-size"><code>feature_background</code></li>
</ul>



<p class="has-small-font-size wp-block-paragraph">the Webhosting template currently ignores those values and always renders the same two-column layout.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The Feature Grid builder stores features directly inside the builder itself.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ features }}
    &lt;article>
        &lt;img src="{{ image }}" alt="{{ image:alt }}">
        &lt;h3>{{ title }}&lt;/h3>
        &lt;p>{{ description }}&lt;/p>
    &lt;/article>
{{ /features }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> features </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">article</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ image }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ image:alt }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h3</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h3</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> description </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">article</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">features </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Unlike My project, there is no imported Features fieldset. The builder owns its own data structure, making it self-contained.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project also relies on Statamic&#8217;s asset augmentation instead of Glide when rendering feature icons.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">CTA implementation</h3>



<p class="has-small-font-size wp-block-paragraph">Both projects reuse buttons throughout the site, but they organise them differently.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">Most sections define their own CTA fields.</p>



<p class="has-small-font-size wp-block-paragraph">For example:</p>



<ul class="wp-block-list">
<li class="has-small-font-size"><code>cta_text</code></li>



<li class="has-small-font-size"><code>cta_link</code></li>
</ul>



<p class="has-small-font-size wp-block-paragraph">These fields are duplicated across several blueprints and rendered directly within the section templates.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;a href="{{ cta_link }}">
    {{ cta_text }}
&lt;/a></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ cta_link }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> cta_text </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Because every section owns its own button fields, changing the button structure would require updating multiple blueprints.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The Live project centralises button behaviour inside a reusable button component.</p>



<p class="has-small-font-size wp-block-paragraph">Builder blocks import a shared CTA fieldset and pass the values into the component.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ partial:components/button
    :link="link"
    :size="size"
    :variant="variant"
}}
    {{ display_text }}
{{ /partial:components/button }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">button</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">link</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">link</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">size</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">size</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">variant</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">variant</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> display_text </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">button </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The shared component also provides sensible defaults.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ size = size ?? 'md' }}
{{ variant = variant ?? 'primary' }}

&lt;a target="_blank"
   class="{{ classes | trim }}"
   href="{{ link }}"></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> size </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> size </span><span style="color: #81A1C1">??</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">md</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> variant </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> variant </span><span style="color: #81A1C1">??</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">primary</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a target</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">_blank</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">   </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ classes | trim }}</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">   href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ link }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This allows every CTA throughout the project to share identical rendering logic while still allowing individual builder blocks to customise the button&#8217;s appearance through parameters such as size or visual variant.</p>



<p class="has-small-font-size wp-block-paragraph">Another noteworthy difference is that the shared button component always opens links in a new browser tab because <code>target="_blank"</code> is hardcoded into the component.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Pricing card rendering</h3>



<p class="has-small-font-size wp-block-paragraph">Although both projects display pricing cards, they generate them differently.</p>



<p class="has-small-font-size wp-block-paragraph">My project primarily renders pricing information directly from individual offer fields, while Markdown generates the feature checklist inside each card.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project relies much more heavily on structured data. Billing information, CTA information, and feature values are each organised into their own logical groups before being combined into the final pricing card.</p>



<p class="has-small-font-size wp-block-paragraph">This results in a more modular implementation where pricing, CTA behaviour, and product features are clearly separated instead of existing as one flat collection of fields.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Contact section vs Support section</h3>



<p class="has-small-font-size wp-block-paragraph">One of the largest differences between the two projects is how customer contact is implemented.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">My project includes a fully functional Statamic Form inside the Contact section.</p>



<p class="has-small-font-size wp-block-paragraph">The contact section imports a reusable <code>contact_card</code> fieldset and delegates the rendering to a shared partial. The wrapper only provides page-specific presentation settings such as spacing, blur images, and image placement.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ partial:google_ads/contact_card
    contact_section_class="relative px-6 py-12"
    contact_blur_image="/assets/google-ads/webhosting/blur-support@3x.webp"
    contact_image_placement="after_details"
}}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">google_ads</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">contact_card</span></span>
<span class="line"><span style="color: #D8DEE9FF">    contact_section_class</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">relative px-6 py-12</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    contact_blur_image</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">/assets/google-ads/webhosting/blur-support@3x.webp</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    contact_image_placement</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">after_details</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The reusable partial then opens a native Statamic form.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ form:contact in="contact" }}

    {{ if success }}
        &lt;p>Vielen Dank, deine Nachricht wurde gesendet.&lt;/p>
    {{ /if }}

    {{ partial:components/contact_form }}

    &lt;button type="submit">
        {{ contact_button_text }}
    &lt;/button>

{{ /form:contact }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> form</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">contact in</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">contact</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> success </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">Vielen Dank</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> deine Nachricht wurde gesendet</span><span style="color: #81A1C1">.</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">contact_form </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">button type</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">submit</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> contact_button_text </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">button</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">form</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">contact </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Because the form uses Statamic&#8217;s built-in form handling, submissions automatically support:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Validation</li>



<li class="has-small-font-size">Error messages</li>



<li class="has-small-font-size">Restoring previously entered values</li>



<li class="has-small-font-size">Success messages</li>



<li class="has-small-font-size">Email notifications</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">For example, submitted values are restored after validation errors.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;input
    name="first_name"
    value="{{ old:first_name }}"
    required
></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">input</span></span>
<span class="line"><span style="color: #D8DEE9FF">    name</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">first_name</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    value</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ old:first_name }}</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    required</span></span>
<span class="line"><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Server-side validation is also defined through the form blueprint.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>handle: first_name

field:
  type: text
  validate:
    - required</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">handle: first_name</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">field:</span></span>
<span class="line"><span style="color: #D8DEE9FF">  type: text</span></span>
<span class="line"><span style="color: #D8DEE9FF">  validate:</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> required</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This creates a fully editable contact section whose functionality is almost entirely driven through Statamic.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The Live project approaches customer contact very differently.</p>



<p class="has-small-font-size wp-block-paragraph">Instead of a contact form, it contains a <strong>Support Card</strong> builder.</p>



<p class="has-small-font-size wp-block-paragraph">Interestingly, the builder itself contains <strong>no editable fields</strong>.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>support_card:
  display: "Support Card"
  fields: {}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">support_card:</span></span>
<span class="line"><span style="color: #D8DEE9FF">  display: </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Support Card</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">  fields: </span><span style="color: #ECEFF4">{}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">All visible content is hardcoded inside the template:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Heading</li>



<li class="has-small-font-size">Body text</li>



<li class="has-small-font-size">Checklist</li>



<li class="has-small-font-size">Staff information</li>



<li class="has-small-font-size">Support image</li>



<li class="has-small-font-size">Button label</li>



<li class="has-small-font-size">Destination</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">The CTA is simply a predefined external link rendered through the shared button component.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ partial:components/button
    variant="primary"
    size="lg"
    link="https://hosttech.ch"
}}

    Support kontaktieren

{{ /partial:components/button }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">button</span></span>
<span class="line"><span style="color: #D8DEE9FF">    variant</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">primary</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    size</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">lg</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    link</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">https://hosttech.ch</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    Support kontaktieren</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">button </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Unlike My project, this section does not submit any data and does not make use of Statamic Forms.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Testimonials / Comments</h3>



<p class="has-small-font-size wp-block-paragraph">Both projects implement customer testimonials using nested Replicators, but the data structure differs.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">Each testimonial contains:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Comment text</li>



<li class="has-small-font-size">Star rating</li>



<li class="has-small-font-size">Reviewer image</li>



<li class="has-small-font-size">Reviewer name</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">Testimonials are rendered in the same order they appear inside the Replicator.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ comment }}

    &lt;article>

        &lt;p>{{ comment_text }}&lt;/p>
        &lt;p>{{ reviewer_name }}&lt;/p>

    &lt;/article>

{{ /comment }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> comment </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">article</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> comment_text </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> reviewer_name </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">article</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">comment </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The template also contains presentation-specific logic.</p>



<p class="has-small-font-size wp-block-paragraph">For example, the second testimonial receives a different layout position on tablet screens.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ if index == 1 }}
    featured-tablet-position
{{ /if }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> index </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">1</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    featured</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">tablet</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">position</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The testimonial heading and decorative quote blur remain hardcoded inside the template.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The Live project structures testimonials slightly differently.</p>



<p class="has-small-font-size wp-block-paragraph">Each testimonial consists of:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Quote text</li>



<li class="has-small-font-size">Rating</li>



<li class="has-small-font-size">Author group
<ul class="wp-block-list">
<li>Name</li>



<li>Avatar</li>
</ul>
</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">Rendering is delegated to the reusable Stars component.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ entries }}

    &lt;p>{{ text }}&lt;/p>

    {{ partial:components/stars stars=stars }}

    &lt;img
        src="{{ author:author_avatar }}"
        alt="{{ author:author_avatar:alt }}"
    >

    &lt;p>{{ author:author_name }}&lt;/p>

{{ /entries }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> entries </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> text </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">stars stars</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF">stars </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img</span></span>
<span class="line"><span style="color: #D8DEE9FF">        src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ author:author_avatar }}</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ author:author_avatar:alt }}</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> author</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">author_name </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">entries </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Unlike My project, the Live implementation separates reviewer information into a dedicated author group and reuses a shared Stars component instead of calculating star icons inside every testimonial template.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Rating implementation</h3>



<p class="has-small-font-size wp-block-paragraph">Both projects store ratings using a <strong>0–10</strong> scale, where every point represents half a star.</p>



<p class="has-small-font-size wp-block-paragraph">The implementation differs significantly.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">The Company section and Comments section both calculate stars directly inside their templates.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ loop from="1" to="5" }}

    {{ if star_amount >= (value * 2) }}

        &lt;i class="fa-solid fa-star">&lt;/i>

    {{ elseif star_amount == ((value * 2) - 1) }}

        &lt;i class="fa-solid fa-star-half-stroke">&lt;/i>

    {{ else }}

        &lt;i class="fa-regular fa-star">&lt;/i>

    {{ /if }}

{{ /loop }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> loop from</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> to</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">5</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> star_amount </span><span style="color: #81A1C1">&gt;=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">value </span><span style="color: #81A1C1">*</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">2</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">i </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">fa-solid fa-star</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">i</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">elseif</span><span style="color: #D8DEE9FF"> star_amount </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">((</span><span style="color: #D8DEE9FF">value </span><span style="color: #81A1C1">*</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">2</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">1</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">i </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">fa-solid fa-star-half-stroke</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">i</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">i </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">fa-regular fa-star</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">i</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">loop </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Each template performs its own conversion from the stored rating into visible star icons.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The Live project performs the same calculation using variables.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ rating = stars ?? 0 }}
{{ full = (rating / 2) | floor }}
{{ has_half = rating % 2 == 1 }}
{{ empty = max - full - (has_half ? 1 : 0) }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> rating </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> stars </span><span style="color: #81A1C1">??</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">0</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> full </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">rating </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">2</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">|</span><span style="color: #D8DEE9FF"> floor </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> has_half </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> rating </span><span style="color: #81A1C1">%</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">2</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">1</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> empty </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> max </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> full </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">has_half </span><span style="color: #81A1C1">?</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">1</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">0</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">However, testimonials do not repeat this calculation.</p>



<p class="has-small-font-size wp-block-paragraph">Instead, they call a reusable component.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ partial:components/stars stars=stars }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">stars stars</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF">stars </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The Certificate block still performs the calculation directly, making it the one exception to this shared approach.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">FAQ implementation</h3>



<p class="has-small-font-size wp-block-paragraph">This is one of the most significant functional differences between the projects.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">My project does not include a dedicated FAQ implementation.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The Live project introduces an interactive FAQ builder powered by Livewire.</p>



<p class="has-small-font-size wp-block-paragraph">The layout converts the Replicator entries into JSON before passing them into the Livewire component.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ livewire:faq
    :faqJson="entries | to_json"
}}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> livewire</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">faq</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">faqJson</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">entries | to_json</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The PHP component stores the FAQ entries together with the currently opened question.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>public array $entries = [];

public ?int $openIndex = null;

public function toggle(int $index): void
{
    $this->openIndex =
        ($this->openIndex === $index)
            ? null
            : $index;
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">array</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">entries</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">[]</span><span style="color: #81A1C1">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?int</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">openIndex</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">null;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">toggle</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">int</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">index</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">void</span></span>
<span class="line"><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">openIndex</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">openIndex</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">===</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">index</span><span style="color: #ECEFF4">)</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">?</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">null</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">index</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Each FAQ item then toggles its own visibility.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;button
    wire:click="toggle({{ id }})"
>

{{ question }}

&lt;/button></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">button</span></span>
<span class="line"><span style="color: #D8DEE9FF">    wire:click</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">toggle({{ id }})</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> question </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">button</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Answers are only rendered while their question is open.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ if is_open }}

    &lt;div>
        {{ answer | markdown }}
    &lt;/div>

{{ /if }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> is_open </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> answer </span><span style="color: #81A1C1">|</span><span style="color: #D8DEE9FF"> markdown </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This keeps both the FAQ content and the interaction state cleanly separated.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Shared frontend components</h3>



<p class="has-small-font-size wp-block-paragraph">The projects differ considerably in how reusable frontend components are organised.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">My project primarily reuses:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Contact Card partial</li>



<li class="has-small-font-size">Contact Form partial</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">Many other elements, such as star rendering, remain embedded directly inside individual templates.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The Live project extracts more functionality into reusable presentation components.</p>



<p class="has-small-font-size wp-block-paragraph">These include:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Shared Button component</li>



<li class="has-small-font-size">Shared Stars component</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">Builder sections simply pass data into these shared components rather than duplicating rendering logic.</p>



<p class="has-small-font-size wp-block-paragraph">This reduces duplicated markup while making styling changes easier to maintain.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Asset rendering</h3>



<p class="has-small-font-size wp-block-paragraph">Another implementation difference is how images are handled.</p>



<p class="has-small-font-size wp-block-paragraph">My project primarily renders images through <strong>Glide</strong>.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>{{ glide:feature_image }}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> glide</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">feature_image </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This generates processed image URLs before rendering them.</p>



<p class="has-small-font-size wp-block-paragraph">The Live project relies mostly on Statamic&#8217;s asset augmentation.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;img
    src="{{ image }}"
    alt="{{ image:alt }}"
></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img</span></span>
<span class="line"><span style="color: #D8DEE9FF">    src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ image }}</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ image:alt }}</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Both methods retrieve asset metadata, although the Live implementation generally produces simpler template code.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Hardcoded vs CMS-managed content</h3>



<p class="has-small-font-size wp-block-paragraph">Both projects intentionally leave certain content outside the CMS.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">My project</h3>



<p class="has-small-font-size wp-block-paragraph">Hardcoded content includes:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Decorative blur images</li>



<li class="has-small-font-size">Hero labels such as &#8220;ab&#8221; and &#8220;/ Monat&#8221;</li>



<li class="has-small-font-size">Comments heading</li>



<li class="has-small-font-size">Responsive layout decisions</li>



<li class="has-small-font-size">Typography</li>



<li class="has-small-font-size">Card styling</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">At the same time, the editable content including contact information and form behaviour is largely managed through Statamic.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">The Live project</h3>



<p class="has-small-font-size wp-block-paragraph">The Live project also keeps several elements in code, including:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Decorative blur images</li>



<li class="has-small-font-size">Support Card content</li>



<li class="has-small-font-size">FAQ heading</li>



<li class="has-small-font-size">FAQ introduction</li>



<li class="has-small-font-size">Support links</li>



<li class="has-small-font-size">SVG icons</li>



<li class="has-small-font-size">Layout styling</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">The difference is that entire sections, such as the Support Card, are intentionally fixed rather than editor-managed.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Shared implementation behaviour</h3>



<p class="has-small-font-size wp-block-paragraph">Despite their differences, both projects share several implementation patterns.</p>



<p class="has-small-font-size wp-block-paragraph">Both:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Use Replicators as the primary page-building mechanism.</li>



<li class="has-small-font-size">Render nested content in the same order editors define in the Control Panel.</li>



<li class="has-small-font-size">Separate blueprints from presentation templates.</li>



<li class="has-small-font-size">Keep decorative styling inside Antlers rather than the CMS.</li>



<li class="has-small-font-size">Store offers separately from landing pages.</li>



<li class="has-small-font-size">Use reusable fieldsets where appropriate.</li>



<li class="has-small-font-size">Keep responsive layout decisions inside the templates rather than inside blueprint configuration.</li>
</ul>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Notable implementation differences</h3>



<p class="has-small-font-size wp-block-paragraph">Some additional implementation differences include:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">The Live project uses a reusable Button component throughout the project, while My project generally renders CTA buttons directly inside section templates.</li>



<li class="has-small-font-size">The Live project reuses a shared Stars component for testimonials, whereas My project performs the star calculation inside each relevant template.</li>



<li class="has-small-font-size">My project includes a fully functional Statamic Form with validation, submission handling, and email notifications, while the Live project uses a hardcoded Support Card that simply links to an external page.</li>



<li class="has-small-font-size">The Live project introduces a Livewire-powered FAQ with interactive expand/collapse behaviour, while My project does not contain a dedicated FAQ implementation.</li>



<li class="has-small-font-size">My project relies primarily on Glide when rendering assets, whereas the Live project mainly uses Statamic&#8217;s asset augmentation.</li>



<li class="has-small-font-size">The Live project extracts more reusable presentation logic into shared frontend components, reducing duplicated markup across builder sections.</li>



<li class="has-small-font-size">My project keeps several section-specific implementations, such as testimonial rendering and button generation, directly inside the individual templates rather than centralising them in shared components.</li>
</ul>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Insights after Wonderland Tasks</title>
		<link>https://flurin-lernjournal.hosttech.ch/insights-after-wonderland-tasks/</link>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Fri, 24 Jul 2026 09:44:00 +0000</pubDate>
				<category><![CDATA[Befehle]]></category>
		<category><![CDATA[Erklärungen]]></category>
		<category><![CDATA[hosttech]]></category>
		<category><![CDATA[Lernjournal]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wonderland]]></category>
		<guid isPermaLink="false">https://flurin-lernjournal.hosttech.ch/?p=1593</guid>

					<description><![CDATA[Task 1, falsche Währungen beim Upgrade eines Accounts: This issue is that when you want to expand and add additional features of your exchange hosting that the currency is CHF even if the user is from germany or austria which is confusing. The first step as always for when working on a task in wonderland [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Task 1, falsche Währungen beim Upgrade eines Accounts:</h3>



<p class="has-small-font-size wp-block-paragraph">This issue is that when you want to expand and add additional features of your exchange hosting that the currency is CHF even if the user is from germany or austria which is confusing.</p>



<p class="has-small-font-size wp-block-paragraph">The first step as always for when working on a task in wonderland or myhosttech is create a new issue and merge request (this automatically creates a new branch). For the title and description you can generally just take the task title, description and translate to English in necessary. Afterwards i opened the wonderland project and switch to the main branch. Now i can pull &amp; fetch the changes so its on the most recent version (pull is for the content and fetch is for the branches).</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="449" height="512" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/wonderland-git.png" alt="" class="wp-image-1595" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/wonderland-git.png 449w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/wonderland-git-263x300.png 263w" sizes="(max-width: 449px) 100vw, 449px" /></figure>



<p class="has-small-font-size wp-block-paragraph">Now with the local project on the most recent version i switch to my newly created branch (via checkout).</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="666" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/wonderland-git1-1024x666.png" alt="" class="wp-image-1596" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/wonderland-git1-1024x666.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/wonderland-git1-300x195.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/wonderland-git1-768x499.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/wonderland-git1.png 1277w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-small-font-size wp-block-paragraph">Go to Remote-&gt;origin and then your desired branch click on it and then press checkout.</p>



<p class="has-small-font-size wp-block-paragraph">After which i open my local test-environment and go to the place where the issue im trying to fix takes place (to recreate the problem so you can see if the changes you made actually fix it). The first though i had was to check via the admin login and then the products of the user. So i went to myhosttech.test/admin-users/products but then i encountered  an error. It tried getting information from a row in the db which didn&#8217;t exist, so i went ahead and check the test database for wonderland locally. The row that it was looking for really didn&#8217;t exist so after a short moment of thinking i realized that changes were made to the db since i last worked with it which meant that i had to build it anew (and &#8220;seed&#8221; it so it also has content).  <br><br>Since i haven&#8217;t been needed to do so in a good while i didn&#8217;t remember how to do so, so i thought about it and remembered that i once wrote something about it in my lernjournal so i went and checked and it was indeed there. Now for safety reasons so i didn&#8217;t accidentally break anything i asked Marco if i want to create the db anew including the content if this command correct: <code>php artisan migrate:fresh --seed</code> or if there&#8217;s anything special i need to do for this project. He told me that i should do it via composer scripts with this command: <code>composer seed:dev</code>. So i went ahead and checked the composer.json file for the script (and therefor command) required since at that moment in time, i didn&#8217;t realize that the command he sent is already the correct one. This is the script in the composer.json file:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">JSON</span><span role="button" tabindex="0" data-code="&quot;seed:dev&quot;: &#91;
    &quot;@migrate:fresh-dev&quot;,
    &quot;@php artisan db:seed -vvv&quot;
&#93;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">seed:dev</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF">: </span><span style="color: #ECEFF4">&#91;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">@migrate:fresh-dev</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">,</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">@php artisan db:seed -vvv</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #ECEFF4">&#93;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">After realizing that the command was the one i required, i went into the myhosttech project (the other half of the entire hosttech project since that is where the db is). There i tried to execute the command: <code>composer seed:dev</code> but it failed, so i tried figuring out what caused the error. After a while of pondering i came across a comment online which said that one possability for the error is that it can&#8217;t find the artisan file or well not with the expected name. With that in mind i went and checked and my artisan file was named &#8220;artisan.exe&#8221; after seeing that i remembered, that a good while ago when i had an issue and looked at that with Manuel we renamed to file to resolve that problem. With that in mind i renamed it back to just &#8220;artisan&#8221; as its inteded to be and tried again and that indeed worked. <br><br>While i still got an error but the error message changed and thats a good thing since that means that you either fixed the issue partially or you are at least working in the right sections / files or whichever it may be. So now again i tried figuring out how to fix the &#8220;new&#8221; error, after a while i wasn&#8217;t able to figure it out so i went ahead and asked Marco. He had a lot more insight than me and we were able to progress rather swiftly, restored some made changes i made locally and then the final issue was the vendor folder. So as per his instructions i deleted the folder and then installed it again with composer install. After the first execution an error came up but that one i remembered is normal for windows or well for me either or not 100% certain so then per instructions from the error message i added this to the command: <code>--ignore-platform-req=ext-pcntl</code> and after the second execution again and then also added: <code>--ignore-platform-req=ext-posix</code> then with the third execution it worked. Here&#8217;s how the final command looked like:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">Bash</span><span role="button" tabindex="0" data-code="composer install --ignore-platform-req=ext-pcntl --ignore-platform-req=ext-posix" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">composer</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">install</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">--ignore-platform-req=ext-pcntl</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">--ignore-platform-req=ext-posix</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Afterwards to clear the cache&#8217;s and so, so nothing old is overwriting the new elements i executed the following command:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">Bash</span><span role="button" tabindex="0" data-code="php artisan optimize" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">php</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">artisan</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">optimize</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Now finally it was time to try and run &#8220;<code>composer seed:dev</code>&#8220;again and this time it worked. With that the database was built anew and seeded so it had some content. Now the final command to execute was: <code>npm install</code> and <code>npm build</code>, though the npm install is optional it doesn&#8217;t hurt.<br><br>With that issue fixed i could access the desired product (mail) but during the process of fixing the error Marco was also kind enough to give me a hint to where the issue is so i went ahead and checked the URL he have me: &#8220;myhosttech.test/user-products/email&#8221;. He was indeed correct and that&#8217;s where the issue was. So the next step was to figure out how to fix this issue in the code and check if it worked as intended in my local test-environment. Now i was already provided with an assumption as how and where to fix the issue and that was in the &#8220;cpaccount.phtml&#8221; so in the view of the cpaccount page.<br><br>The next step was to figure out how i need to adjust the code to fix the issue, while i already know where the issue should lie in i didn&#8217;t know how to adjust the code, so that was my next task. For that i looked over the cpaccount.phtml file and looked to see if there was already another instance where currency is involved and there indeed was, the currency of the user stored in a variable. With me thinking that, that&#8217;s the most efficient way to fix this since i just needed to replace part of a string with a variable i went ahead and made the change.</p>



<p class="has-small-font-size wp-block-paragraph">From this:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;strong&gt;
    &lt;label class=&quot;tw-align-bottom tw-ml-4&quot; style=&quot;padding-top: 2px;&quot; for=&quot;konfoptionvalue&#91;&lt;?= $oOptionValue-&gt;id ?&gt;&#93;&quot;&gt;&lt;?= ' + CHF ' . CurrencyHelper::formatCurrency($priceForUpgrade) ?&gt;
    &lt;/label&gt;
&lt;/strong&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">strong</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">label </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">tw-align-bottom tw-ml-4</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> style</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">padding-top: 2px;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">for=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">konfoptionvalue&#91;&lt;?= </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oOptionValue</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #A3BE8C"> ?&gt;&#93;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;?=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C"> + CHF </span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">CurrencyHelper</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">formatCurrency</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">priceForUpgrade</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">label</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">strong</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">To this:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="$sCurrency = $oUser-&gt;getCurrency(); // what the $sCurrency variable stores

&lt;strong&gt;
    &lt;label class=&quot;tw-align-bottom tw-ml-4&quot; style=&quot;padding-top: 2px;&quot; for=&quot;konfoptionvalue&#91;&lt;?= $oOptionValue-&gt;id ?&gt;&#93;&quot;&gt;&lt;?= &quot; + $sCurrency &quot; . CurrencyHelper::formatCurrency($priceForUpgrade) ?&gt;            
     &lt;/label&gt;
&lt;/strong&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">sCurrency</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oUser</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getCurrency</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// what the $sCurrency variable stores</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">strong</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">label </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">tw-align-bottom tw-ml-4</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> style</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">padding-top: 2px;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">for=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">konfoptionvalue&#91;&lt;?= </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oOptionValue</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #A3BE8C"> ?&gt;&#93;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;?=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> + </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">sCurrency</span><span style="color: #A3BE8C"> </span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">CurrencyHelper</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">formatCurrency</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">priceForUpgrade</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF">            </span></span>
<span class="line"><span style="color: #D8DEE9FF">     </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">label</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">strong</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">So two changes were made, firstly i changed the hardcoded &#8220;CHF&#8221; string to the &#8220;$sCurrency&#8221; and secondly since the single quotation marks ignore variable and such i switched them to double quotation marks so it doesn&#8217;t read out &#8220;$sCurrency&#8221; as it would with single quotation marks but the value &#8220;CHF / EUR&#8221; depending on the user. Now to check if it actually worked i had to change the currency from the user, for that i had to go into the db and adjust some values, like the country &amp; currency of the user. After checking both and it working seamlessly i committed the changes i made. There to note is that the commit message should be concise and have &#8220;, implements #xxxx (issue / mr / branch number)&#8221; its the same number for all three of them since they share it albeit its originally the issue number.<br><br>After committing the changes i made i changes to labels of the merge request &amp; issue to &#8220;To Review&#8221; and proceeded with other tasks. After a bit Marco reviewed my changes and left a comment (thread in git) giving me a hint that there is an even easier way to reach the goal of that line of code. That being with the &#8220;CurrencyHelper.php&#8221; and its &#8220;formatCurrency&#8221; function since it already includes everything that is needed, the value, the currency and you can set the operand (+/-) before the currency.<br>So then the final change looked like this:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;strong&gt;
    &lt;label class=&quot;tw-align-bottom tw-ml-4&quot; style=&quot;padding-top: 2px;&quot; for=&quot;konfoptionvalue&#91;&lt;?= $oOptionValue-&gt;id ?&gt;&#93;&quot;&gt;&lt;?= CurrencyHelper::formatCurrency($priceForUpgrade, $sCurrency, true) ?&gt;
    &lt;/label&gt;
&lt;/strong&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">strong</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">label </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">tw-align-bottom tw-ml-4</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> style</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">padding-top: 2px;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">for=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">konfoptionvalue&#91;&lt;?= </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oOptionValue</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #A3BE8C"> ?&gt;&#93;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;?=</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">CurrencyHelper</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">formatCurrency</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">priceForUpgrade</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">sCurrency</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">true</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">label</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">strong</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This makes it a good bit simpler again since now you just have one continues call for the different values via a single function. This also avoids string concatenation (joining two or more text strings end-to-end to create a single combined string) which makes it better.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Task 2, Anzeigefehler im Inventarsystem:</h3>



<p class="has-small-font-size wp-block-paragraph">This is an issue that when a new button is shown that the last button isn&#8217;t visible anymore which is a problem especially since in this case its the delete button. And as a extra task add an elipsis (&#8230;) for the rackslot name / column.</p>



<p class="has-small-font-size wp-block-paragraph">Here same as always i first created an issue and merge request and quickly check if there&#8217;s anything new with &#8220;git pull &amp; fetch&#8221; and then switch to the new branch.</p>



<p class="has-small-font-size wp-block-paragraph">Just as before the first thing did is open my local test environment and check where the issue takes place. For this task i recieved the link to where the issue takes place in: &#8220;myhosttech.eu/admin-inventory/systems&#8221;. Before doing much of anything there i opened the db and the respective tables that i require or well i think contain what i require. After a bit i found what i was looking for and looked for a system but then i encountered the following error: </p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="SQLSTATE&#91;42000&#93;: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system = '4')' at line 1." style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">SQLSTATE</span><span style="color: #ECEFF4">&#91;</span><span style="color: #B48EAD">42000</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> Syntax error </span><span style="color: #81A1C1">or</span><span style="color: #D8DEE9FF"> access violation</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">1064</span><span style="color: #D8DEE9FF"> You have an error in your SQL syntax</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> check the manual that corresponds to your MySQL server version </span><span style="color: #81A1C1">for</span><span style="color: #D8DEE9FF"> the right syntax to </span><span style="color: #81A1C1">use</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">near</span><span style="color: #D8DEE9FF"> &#39;</span><span style="color: #8FBCBB">system</span><span style="color: #D8DEE9FF"> = &#39;4&#39;)&#39; </span><span style="color: #8FBCBB">at</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">line</span><span style="color: #D8DEE9FF"> 1.</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">I attempted to see if i get the same error when i try to access the systems via another way than the search for example via the &#8220;unassigned systems&#8221;, whether or not it also happens if i search for a different system or if the problems lies withing one of the given values of the rows inside the table or something alike. After a while of thinking and trial &amp; error and me not being able to figure it out i opted for asking Marco since i was out of ideas and any more time spent from me thinking of a possible solution would be wasted time. He checked if that issue also existed in his local test environment and it did which he didn&#8217;t quite expect since he never encountered that error before. After a bit he was able to figure out where the issue resided in, that being the &#8220;InvSystem.php&#8221; model. This line:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="return $products-&gt;fetchAll([&quot;system = :id&quot; =&gt; &#91;'id' =&gt; $this-&gt;id&#93;]);" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">products</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">fetchAll</span><span style="color: #ECEFF4">([</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">system = :id</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">id</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #ECEFF4">&#93;])</span><span style="color: #81A1C1">;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The problem is that php recognises this as a sql command (SELECT `invproducts`.* FROM `invproducts` WHERE (system = &#8216;4&#8217;)) and therefor tries to get the invproducts via the system id which doesn&#8217;t exist that way, well this path to be more exact. So to fix that i had to add these two: &#8220; before and after &#8220;system&#8221; like so:  </p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="return $products-&gt;fetchAll([&quot;`system` = :id&quot; =&gt; &#91;'id' =&gt; $this-&gt;id&#93;]);" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">products</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">fetchAll</span><span style="color: #ECEFF4">([</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">`system` = :id</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">id</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #ECEFF4">&#93;])</span><span style="color: #81A1C1">;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This makes it so that it doesn&#8217;t count / recognise it as a sql command anymore meaning that it doesn&#8217;t try and find the invproducts anymore which fixes the error. Afterwards Marco offered / asked if i would like to also quickly take a look together on how to recreate the issue properly and after quickly thinking about it i decided to accept his offer because it will be a lot faster that way and i at the time didn&#8217;t have a specific idea on how to go about figuring it out, albeit in my defense i didn&#8217;t think or look at it yet. So first we tried adding a value in the db since there existed a column called &#8220;konfigurator_id&#8221; but that wasn&#8217;t it then he recommended checking the view to see the condition to display the button we want to display for the error to take place. So i checked the view file (systems.phtml) and looked for the corresponding button:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;?php if ((int) $system-&gt;type === 13): ?&gt;&lt;a class=&quot;triggerPushConfigurator&quot; server_name=&quot;&lt;?= $system-&gt;name ?&gt;&quot; server_id=&quot;&lt;?= $system-&gt;id ?&gt;&quot; href=&quot;#&quot;&gt;&lt;img class=&quot;hoverImage&quot; border=0 src=&quot;/img/admin/icons/go.png&quot; title=&quot;Im neuen Konfigurator erstellen/aktualisieren&quot; /&gt;&lt;/a&gt;&lt;?php endif; ?&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">((</span><span style="color: #81A1C1">int</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">system</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">type</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">===</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">13</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;&lt;</span><span style="color: #D8DEE9FF">a </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">triggerPushConfigurator</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> server_name</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">&lt;?= </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">system</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">name</span><span style="color: #A3BE8C"> ?&gt;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> server_id</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">&lt;?= </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">system</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #A3BE8C"> ?&gt;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">#</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">img </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">hoverImage</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> border</span><span style="color: #81A1C1">=</span><span style="color: #B48EAD">0</span><span style="color: #D8DEE9FF"> src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">/img/admin/icons/go.png</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> title</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Im neuen Konfigurator erstellen/aktualisieren</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/&gt;&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">endif;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">So as one can see it needs to be a system type 13 for the button to be displayed so i adjusted that in the db. With the error now recreated Marco went do his own things again and i created a second system without the extra button this time as a reference and then went ahead and looks via site inspect and project wide search (ctrl + shift + f) which .css file contains the styling for this page. After finding the systems.css file i adjusted the respective styles of the selected columns. Afterwards i tried committing the changes made but noticed that i can&#8217;t commit the css file, since i didn&#8217;t know why i asked Simon as he was here in person and he told me to ask Marco as to why not and mentioned .scss files. With that i asked Marco and he explained that scss (Sassy CSS) is basically a template from which once the project get launched in production that it then generates the .css files from said .scss files. Scss makes it easier to write css since nesting is made a lot simpler, like so:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="507" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/scss-1024x507.png" alt="" class="wp-image-1598" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/scss-1024x507.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/scss-300x149.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/scss-768x380.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/scss.png 1312w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-small-font-size wp-block-paragraph">I asked Marco that since the .scss files are for generating the .css files if your working in your local environment if you should make the changes in the .css files or the .scss file. A good question (his words) he said that generally you should just do it in the .scss file and then generate the .css files with this command:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">Bash</span><span role="button" tabindex="0" data-code="composer run wonderland:scss" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">composer</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">run</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">wonderland:scss</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Though i&#8217;d have to say that to test if the changes work it should be more than fine to do it in the .css file at least if its on a small scale.<br>So with that newly acquired knowledge i moved the changed from the .css file to the .scss file and committed them. Here also, as always a concise commit message and &#8220;, implements #xxxx&#8221; at the end.</p>



<p class="has-small-font-size wp-block-paragraph">After committing the changes i set the tag to &#8220;To Review&#8221; as usual and went ahead and do some other tasks. After a bit i received feedback from Marco that i should also add a title tag so the truncated Rackslot so you can still read the whole name via tooltip. For that i looked at how it was done with the name &amp; type and basically copied what was done there. Now i looked at how i need to modify it so it displays the correct information in the tooltip. I knew that it needed to display what is already displayed as a link so i went about figuring out how to best implement this.</p>



<p class="has-small-font-size wp-block-paragraph">The way it was currently made, is that it gets the values it needs inside the div and then handles &amp; displayed that based on an &#8220;if condition&#8221; (that being that the system has a &#8220;RackSlots&#8221; value). Now the tooltip is in the div so i already knew that i needed to extract the data preparation to above the div element. Now another thing that made sense is now that im using the information of the rackslot twice i can save it in a variable and then just call said variable in the title and link to save code lines.</p>



<p class="has-small-font-size wp-block-paragraph">From this:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;div class=&quot;columnContent columnContent8 small&quot;&gt;
    &lt;? $oRackSlot = RackSlots::getByInvSystemID($system-&gt;id); ?&gt;
    &lt;? if(!empty($oRackSlot)) { ?&gt;
        &lt;? $oRack = $oRackSlot-&gt;getRack(); ?&gt;
        &lt;a class=&quot;link&quot; method=&quot;POST&quot; target=&quot;_blank&quot; href=&quot;/admin-servers/rackslots?id=&lt;?=$oRackSlot-&gt;id?&gt;&quot;&gt;
            &lt;?=$oRack-&gt;getDatacenterName()?&gt; / &lt;?=$oRack-&gt;name?&gt; / &lt;?=$oRackSlot-&gt;slot?&gt;
        &lt;/a&gt;
    &lt;? } ?&gt;
&lt;/div&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">columnContent columnContent8 small</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRackSlot</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">RackSlots</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">getByInvSystemID</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">system</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">!empty</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRackSlot</span><span style="color: #ECEFF4">))</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRack</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRackSlot</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getRack</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">link</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> method</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">POST</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> target</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">_blank</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">/admin-servers/rackslots?id=&lt;?=</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRackSlot</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #A3BE8C">?&gt;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;?=$</span><span style="color: #D8DEE9">oRack</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getDatacenterName</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?=$</span><span style="color: #D8DEE9">oRack</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">name</span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?=$</span><span style="color: #D8DEE9">oRackSlot</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">slot</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF"> } </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">To this:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;?php
$oRackSlot = RackSlots::getByInvSystemID($system-&gt;id);

$title = '';

if (!empty($oRackSlot)) {
    $oRack = $oRackSlot-&gt;getRack();
    $title = $oRack-&gt;getDatacenterName() . ' / ' . $oRack-&gt;name . ' / ' . $oRackSlot-&gt;slot;
}
?&gt;
&lt;div class=&quot;columnContent columnContent8 small tooltip&quot; title=&quot;&lt;?= $title ?&gt;&quot;&gt;
    &lt;?php if (!empty($oRackSlot)) { ?&gt;
        &lt;a class=&quot;link&quot; method=&quot;POST&quot; target=&quot;_blank&quot; href=&quot;/admin-servers/rackslots?id=&lt;?= $oRackSlot-&gt;id ?&gt;&quot;&gt;
            &lt;?= $title ?&gt;
        &lt;/a&gt;
    &lt;?php } ?&gt;
&lt;/div&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php</span></span>
<span class="line"><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRackSlot</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">RackSlots</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">getByInvSystemID</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">system</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">title</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;&#39;</span><span style="color: #81A1C1">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">!empty</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRackSlot</span><span style="color: #ECEFF4">))</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRack</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRackSlot</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getRack</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">title</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRack</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getDatacenterName</span><span style="color: #ECEFF4">()</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C"> / </span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRack</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">name</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C"> / </span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRackSlot</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">slot</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">columnContent columnContent8 small tooltip</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> title</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">&lt;?= </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">title</span><span style="color: #A3BE8C"> ?&gt;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">!empty</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRackSlot</span><span style="color: #ECEFF4">))</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">link</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> method</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">POST</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> target</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">_blank</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">/admin-servers/rackslots?id=&lt;?= </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oRackSlot</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #A3BE8C"> ?&gt;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;?=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">title</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php } </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">So the changes i made are the following:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">&lt;? $oRackSlot = RackSlots::getByInvSystemID($system-&gt;id); ?&gt; -&gt; moved above the div so avalible for the title </li>



<li class="has-small-font-size">$title = &#8216; &#8216; ; -&gt; so that it doesn&#8217;t give an error that it can&#8217;t find the variable when the if condition isn&#8217;t met</li>



<li class="has-small-font-size">if (!empty($oRackSlot)) {<br>      $oRack = $oRackSlot-&gt;getRack();<br>      $title = $oRack-&gt;getDatacenterName() . &#8216; / &#8216; . $oRack-&gt;name . &#8216; / &#8216; . $oRackSlot-&gt;slot;<br>} -&gt; copied the if condition as to keep the logic the same with the &#8220;$oRack&#8221; &amp; &#8220;$title&#8221; variables</li>



<li class="has-small-font-size">&lt;div class=&#8221;columnContent columnContent8 small tooltip&#8221; title=&#8221;&lt;?= $title ?&gt;&#8221;&gt; -&gt; added the title with the &#8220;$title&#8221; variable as its value and if the if condition isn&#8217;t met it just displays nothing so the tooltip won&#8217;t show up.</li>



<li class="has-small-font-size">&lt;?= $title ?&gt; -&gt; changed to the &#8220;$title&#8221; variable as it has the logic stored as before directly in the link</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">Then i tested if it worked properly with the tooltip and it not showing up or anything breaking when there is no &#8220;RackSlots&#8221; value. Seeing as everything worked i committed the changes and set the labels back to review and wrote a short answer to the comment from Marco with what i did. </p>



<h2 class="wp-block-heading has-large-font-size">The Sequel</h2>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Task 2-1, Remove Managedhostings (MH) mass changes</h3>



<p class="has-small-font-size wp-block-paragraph">The issue is that in the managed hostings tab (Server-&gt;Serververwaltung-&gt;Managed Hostings) <a href="https://myhosttech.test/admin-servers/managedhostings">https://myhosttech.test/admin-servers/managedhostings</a> there is a button that isn&#8217;t used anymore and can / should therefor be removed along with its dependencies (but leaving the MH models alone).</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="108" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/massenanderung-remove-1024x108.png" alt="" class="wp-image-1641" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/massenanderung-remove-1024x108.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/massenanderung-remove-300x32.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/massenanderung-remove-768x81.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/massenanderung-remove.png 1312w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-small-font-size wp-block-paragraph">The first step/s were the same as always, prepping everything so you can start working (create Merge Request, update local project, branch to said MR branch), etc.</p>



<p class="has-small-font-size wp-block-paragraph">I started with searching for keywords that i had accessible, that being the &#8220;Massenänderung&#8221; text from the button and then from the popup that came once you pressed the button. After that i looked through the now opened files from the search before and then looked if there are good keywords to use with &#8220;Ctrl + Shift &#8220;+ F&#8221; or any functions that might link or get references in a different location. At this point in time i didn&#8217;t look if they are models (and exclude them therefor) as i just wanted the whole picture, in that sense. So now with everything open i read through the code and tried make sense of what im reading, what comes from where, which event triggers what all these sort of things.</p>



<p class="has-small-font-size wp-block-paragraph">After looking everything through i quickly asked roman what the section from the task description meant: &#8220;(natürlich ohne die MH Models etc.)&#8221;. That is because i wasn&#8217;t sure if it mean that the model itself need to remain existing but you can remove functions or sections that aren&#8217;t needed anymore or if they should remain completely untouched. He said that it probably means that they should remain untouched as there could still be content in the database which still need it or something alike, but he also said i can just delete the sections or even the Models that are removeable since if not wanted then you can just revert it or well also leave it and if requested after review to also remove said elements then just do so then.<br>I opted for the second option, to just leave the Models alone and delete them or sections from them when specifically requested as (at least for me) it seems that it would cause less work and confusion. </p>



<p class="has-small-font-size wp-block-paragraph">With that cleared i deleted everything (besides the Models) and tested everything. Here&#8217;s what i deleted:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Processmanagedhosting‎smasschangesAction.php (entire file), responsible for finding existing pending/in-progress mass changes, asks each one to continue processing itself, and converts processing failures into an error status while logging the exception.</li>



<li class="has-small-font-size">AdminAjaxCo‎ntroller.php (&#8220;managedhostingmasschangesAction&#8221; function), responsible for the creation and queuing of mass changes, including loading the form and creating the selected mass-change jobs for later processing.</li>



<li class="has-small-font-size">ManagedhostingMa‎ssChangeForm.php‎ (entire file), responsible for creating the form</li>



<li class="has-small-font-size">managedhos‎tings.phtml‎ (2 sections: rendering of the button &amp; div class if it has running masschanges), responsible for displaying the content of the managed hosting (serververwaltung) page.</li>



<li class="has-small-font-size">managedho‎stings.js (2 functions: on click detection for the button to display the form &amp; &#8220;prepareMassChangeForm&#8221; function), responsible for preparing and displaying the form on button click.</li>



<li class="has-small-font-size">managedhos‎tings.scss (&#8220;.small.massChange&#8221; style), the class that would get added on the managed hostings page when there are running masschanges.</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">Then i committed and pushed everything and set it to review.</p>



<p class="has-small-font-size wp-block-paragraph">The review (from Christoph) i got said that the Models only existing for the masschanges feature can be removed and the table/s dropped via a migration but that Simon has the final say. Shortly after Simon replied that the models and table/s can be removed as they are a standalone dependency. So with this information in mind i went ahead with that. I already had all or well most of the models at hand as i searched them out beforehand but i had a question. As the database runs over the myhosttech part of the project and this merge request / branch is in the wonderland part i wasn&#8217;t sure how i was supposed to do this. So i went ahead and asked Simon about what or well how i should go about this and he said just create a merge request in the myhosttech part and then link the respective other MR in them so that they are connected. <br><br>So i created a new Issue &amp; MR in the myhosttech part and then linked the wonderland MR in there (the newly created issue) and the myhosttech MR in the wonderland issue, so you could access and connect them through / with one another.</p>



<p class="has-small-font-size wp-block-paragraph">While i already knew what i can / need to remove (in the wonderland part) of the models as i already checked when i got the task. I quickly went over everything again to see if i might&#8217;ve missed / overlooked something. With everything checked i went ahead with removing the Models that only existed for the MH Masschanges and also the functions for the masschanges inside the &#8220;Managedhostings.php&#8221; Model file. After deleting everything i looked through my changes and the project files (2x Shift &amp; Ctrl + Shift + F) to make sure i deleted the correct parts and not also accidentally something else (which shouldn&#8217;t be the case but never hurts to check) and if that truly was everything. I then quickly looked over the test enviorment (myhosttech.test) to see if i get any sort of special error or anything but all looked well. <br>So with that given i went ahead and wrote the commit message. I didn&#8217;t commit the changes yet as i wanted to delete the table in the myhosttech part as well and then commit both at the same time. As for why, it just seemed simpler to do so. Then the whole task is complete and can be marked as &#8220;To be Reviewed&#8221; instead of just 1 sub-task after another. </p>



<p class="has-small-font-size wp-block-paragraph">With the part in the wonderland half done &amp; prepared i went ahead into the myhosttech half. The first thing i did is open MySQL Workbench to find which table/s are used for the MH masschanges to know which one/s can or well should be removed. For that i went to check under the start letter &#8220;M&#8221; as both &#8220;masschanges&#8221; and &#8220;managedhostings&#8221; start with it so changes are high that the searched table/s will be there and it was: &#8220;managedhostings_masschanges&#8221;. I quickly flew over all the other tables but none stood out. Now knowing which table i need to remove i knew that its wanted that i write a migration to remove it. As i didn&#8217;t know much about migrations i educated myself a bit and oriented myself on past migrations to give me an idea on how it has to look like. After a bit of reading and looking i wrote up a draft for the migration and then i used references (online and past migrations) to see if it looked correct accordingly and i also used AI to explain the lines of code to make sure that what i had in mind was actually correct and also if i might&#8217;ve possibly made an error. With it looking like its correct and my understanding was almost fully there i went ahead and tested it. I ran the migration locally, like so:</p>



<p class="has-small-font-size wp-block-paragraph">up(), delete table:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="php artisan migrate --path=&quot;database/migrations/2026/2026_09_01_120000_drop_managedhostings_masschanges_table.php&quot;
php artisan tinker
  Schema::hasTable('managedhostings_masschanges'); // inside &quot;php artisan tinker&quot;, should return: false" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">php artisan migrate </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9FF">path</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">database/migrations/2026/2026_09_01_120000_drop_managedhostings_masschanges_table.php</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">php artisan tinker</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #8FBCBB">Schema</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">hasTable</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">managedhostings_masschanges</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// inside &quot;php artisan tinker&quot;, should return: false</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">down(), create table (revert migrations):</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="php artisan migrate:rollback --path=&quot;database/migrations/2026/2026_09_01_120000_drop_managedhostings_masschanges_table.php&quot;
php artisan tinker
  Schema::hasTable('managedhostings_masschanges'); // inside &quot;php artisan tinker&quot;, should return: true" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">php artisan migrate</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">rollback </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9FF">path</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">database/migrations/2026/2026_09_01_120000_drop_managedhostings_masschanges_table.php</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">php artisan tinker</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #8FBCBB">Schema</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">hasTable</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">managedhostings_masschanges</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// inside &quot;php artisan tinker&quot;, should return: true</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">To check if it created everything correctly you can you this inside &#8220;php artisan tinker&#8221;:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="Schema::getColumnListing('managedhostings_masschanges'); // shows the column names
DB::select('SHOW COLUMNS FROM managedhostings_masschanges'); // additionally shows the MySQL definitions (Datatypes &amp; AI, NN, etc.)
DB::select('SHOW CREATE TABLE managedhostings_masschanges'); // also shows the character set, collation, primary key &amp; column definitions" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #8FBCBB">Schema</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">getColumnListing</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">managedhostings_masschanges</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// shows the column names</span></span>
<span class="line"><span style="color: #8FBCBB">DB</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">select</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">SHOW COLUMNS FROM managedhostings_masschanges</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// additionally shows the MySQL definitions (Datatypes &amp; AI, NN, etc.)</span></span>
<span class="line"><span style="color: #8FBCBB">DB</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">select</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">SHOW CREATE TABLE managedhostings_masschanges</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// also shows the character set, collation, primary key &amp; column definitions</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">With all the tests returning the intended values i did a quick check in the local test environment to see if i get a fatal error in a few possible relevant pages but it all still worked as intended. With the migrations working and the local test environment still functional i prepared the commit message and then submitted both sub-tasks (one in each project half) opened the MR in git and set them both to &#8220;To Review&#8221;.</p>



<h3 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Task 2-2, Limit email attachments for the ticket answer form</h3>



<p class="has-small-font-size wp-block-paragraph">The goal of this task is to limit the attachment size for the ticket form uploads to 20MB. It said to implement so for the admin forms and check if it already exists like so for the customer forms and if not implement it there as well. So here just like always, i created an issue and a MR with the according information and then switched to the responding branch and started with the task. </p>



<p class="has-small-font-size wp-block-paragraph">The first thing i did here is to open up the local test environment and look up all the necessary forms which were presumably 4 (admin create / respond &amp; customer create / respond).  The reason why i did this first is because there might be some keywords i can use to try and find the correct forms / files for this task. Because there&#8217;s no guarantee that all of the files have the name &#8220;ticket&#8221; or &#8220;answer / create&#8221; in them. Its like a type of secondary search procedure. So after that i looked for the necessary files, there i usually do both even if i know that i already got all the files i need with the main one (using given keywords known from the task or the description). With the necessary files at hand i could proceed to look over them and look if and / or how the attachment size upload limit is implemented.</p>



<p class="has-small-font-size wp-block-paragraph">Surprisingly all of the forms had some type or form of limitation implemented though it differ greatly between the customer forms and the admin forms. The two main ones being that the limit for the admin forms was 10MB while the customer forms had 20MB and the validation only occurred on the admin forms when submitting the form while on the customer forms they are already validated during / after the uploading the attachment (the second difference is one i only noticed later and also lead to me quickly asking Nicolas about it before reaching enlightenment and figuring it out). Now during said testing of the upload limits and all i came across a problem, the adjustments i made on the admin forms didn&#8217;t seem to have any type of affect. I was certain that i had indeed the correct file at hand but somehow it still didn&#8217;t work. After a bit of trying to figure out where the issue lied i turned to Simon. He told me then that there are new and old admin ticket (create &amp; answer) forms but to be able to see them you have to give your admin special permissions to be able to view them. So i went ahead and did the changes as and how he instructed and then i was able to indeed see old and new admin ticket answer / create forms. </p>



<p class="has-small-font-size wp-block-paragraph">Now with me seeing the actual correct forms i was able to proceed with my task. Now shortly after i encountered a new error and that being that if i exceeded a certain total attachment size i got an error before i reached the actual validation of the form attachment. Now after a bit of searching a was able to narrow it down to a select few locations on which limit could cause that. Now one thing that i didn&#8217;t realize is that one of the selected one actually are split into two and after Simon passed by for something i quickly asked him and he told me that the php file size limit isn&#8217;t from nginx but from herd. So with that knowledge i set a higher MB value in herd (Herd-&gt;PHP-&gt;Max File Upload Size) to be exact 50MB (it was 5MB before).</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="688" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/herd-file-upload-limit-1024x688.png" alt="" class="wp-image-1648" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/herd-file-upload-limit-1024x688.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/herd-file-upload-limit-300x201.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/herd-file-upload-limit-768x516.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/07/herd-file-upload-limit.png 1248w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-small-font-size wp-block-paragraph"> Now i could once again proceed with my testing&#8217;s. This is also where i asked Nico about the validation and he kindly offered me that i should just remind him tomorrow if i hadn&#8217;t figured it out by then and he also asked the next morning if i was able to solve it (which i was as mentioned above i gained enlightenment). To elaborate a bit i was confused on why the validation wasn&#8217;t kicking in even though i thought it was supposed to after uploading a file that is above 20MB. The reason for the confusion stood from the fact that it wasn&#8217;t logical for me to only validate that on form submit and not on file upload, this was boosted even more by the fact that for the customer forms it did validate the files after / during the upload. <br>I don&#8217;t fully remember in what or how exactly it happened but i was trying to fix an error and with that i somehow managed to break my whole local testing environment. I couldn&#8217;t lead the url (myhosttech.test) anymore but all still looked correctly bound with herd and all that. So then i went on a goose chase trying to fix it again and it ended in me just basically setting the testing environment up anew. For that i just followed the instructions from the bookstack entry with some slight assistance from AI. </p>



<p class="has-small-font-size wp-block-paragraph">With the test environment working again i was able to finalize my testing and confirmed that the adjustment from 10MB to 20MB worked:</p>



<p class="has-small-font-size wp-block-paragraph">From:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="#[Validate(['files.*' =&gt; &#91;'file',  'max:10240'&#93;])] // this is KB but translates to 10MB. Also the KB is written in binary" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">#[Validate</span><span style="color: #ECEFF4">([</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">files.*</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">file</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF">  </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">max:10240</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">&#93;])</span><span style="color: #D8DEE9FF">] </span><span style="color: #616E88">// this is KB but translates to 10MB. Also the KB is written in binary</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">To:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="#[Validate(['files.*' =&gt; &#91;'file',  'max:20480'&#93;])] // this is KB but translates to 20MB. Also the KB is written in binary" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">#[Validate</span><span style="color: #ECEFF4">([</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">files.*</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">file</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF">  </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">max:20480</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">&#93;])</span><span style="color: #D8DEE9FF">] </span><span style="color: #616E88">// this is KB but translates to 20MB. Also the KB is written in binary</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Now it might seemed a lot of work that occurred for just changing 3 numbers and while true it can happen that something so small can turn into a lot of work because of unexpected errors and what also cost a good bit of time is me somehow breaking my local testing environment and having to fix it. But with everything done i committed it and set it to &#8220;To Review&#8221;.</p>



<p class="has-small-font-size wp-block-paragraph">Christoph gave the following feedback:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-small-font-size wp-block-paragraph">It is possible to upload multiple attachments, which overall size must not exceed a certain value (20MB). All of them will be attached to the email going out: we must respect the limits of SMTP server.<br>Currently, we only validate each attachments file size, not the overall file size. It may be possible using: validating using closure, or: custom validation rule class.</p>
</blockquote>



<p class="has-small-font-size wp-block-paragraph">I didn&#8217;t know that it was intended for the 20MB limit to apply to all uploaded attachments and not for every single file as it wasn&#8217;t particularly phrased that way nor specifically told but that aside i got the information now so i can go ahead and well at least try and implement the wanted changes. <br>He hinted towards 2 possible solutions: closure or custom validation rule class, these terms weren&#8217;t familiar to me so i went ahead and researched about them. What a closure validation is or does in Laravel, same with the custom validation rule class and how they compare to one another, so when one would rather be used over the other and all that. Here i used AI for assistance mainly for the comparison and use cases as i didn&#8217;t find much of any useful sites online. <br>With the research concluded i ended with the conclusion that a custom validation rule class would be more fitting as the validation will be used / required 4 times and will minimize duplicate code. &#8220;closure&#8221; would work as well but the same code would have to be reused at the 4 locations which isn&#8217;t very &#8220;clean&#8221;. Having decided on which im going to implement it was time to figure out on how to actually implement it.</p>



<p class="has-small-font-size wp-block-paragraph">The first step for that to think about what the validation is actually supposed to do and then create a function for it (the only exception is the &#8220;validation()&#8221; function as it is required for a custom validation rule class). I ended with 4 functions:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">__construct() -&gt; Initializes the validation rule with the maximum allowed total file size and its human-readable label.</li>



<li class="has-small-font-size">passes() -&gt; Checks whether the combined size of all uploaded files stays within the configured maximum.</li>



<li class="has-small-font-size">message() -&gt; Returns the validation error message shown when the total file size exceeds the allowed limit.</li>



<li class="has-small-font-size">validate() -&gt;The Laravel-required method that runs the rule and triggers a validation failure when &#8220;passes()&#8221; returns &#8220;false&#8221;.</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">As for the names (again asides from &#8220;validate()&#8221;) just pick a fitting one. For mine the one that might be a tad confusing is the &#8220;passes()&#8221; function the reason i choose that is because i thought about it in a sense &#8220;passing through &#8230;&#8221; so the files you want to check have to pass through what&#8217;s given in said function basically like a form of passage.<br>With the functions at hand all that was left, was to add the necessary / wanted code to them.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;?php // Starts the PHP file.

namespace App\Rules; // Places this class in the App\Rules namespace.

use Closure; // Imports the Closure type used for Laravel's $fail callback.
use Illuminate\Contracts\Validation\ValidationRule; // Imports Laravel's validation rule interface.
use Illuminate\Http\UploadedFile; // Imports Laravel's uploaded file class.

readonly class MaxTotalFileSize implements ValidationRule // Defines a readonly custom validation rule.
{
    public function __construct( // Creates the rule with its required configuration.
        private int $maximumBytes, // Maximum allowed combined file size in bytes.
        private string $formattedMaximum, // Human-readable maximum size, e.g. &quot;10 MB&quot;.
    ) {
    }

    public function passes(string $attribute, mixed $value): bool // Checks whether the files pass the size limit.
    {
        if (!is_array($value)) { // If the validated value is not an array...
            return true; // ...this rule does not consider it invalid.
        }

        $totalBytes = array_sum(array_map( // Calculates the total size of all uploaded files.
            static fn (mixed $file): int =&gt; $file instanceof UploadedFile // Checks if the item is an uploaded file.
                ? (int) $file-&gt;getSize() // If yes, use its size in bytes.
                : 0, // If not, count its size as zero.
            $value, // The array of files to process.
        ));

        return $totalBytes &lt;= $this-&gt;maximumBytes; // Passes if the total size is within the limit.
    }

    public function message(): string // Builds the validation error message.
    {
        return trans('validation.attachments_total_size_max', &#91; // Loads the translated validation message.
            'size' =&gt; $this-&gt;formattedMaximum, // Replaces the :size placeholder with the formatted maximum.
        &#93;);
    }

    public function validate(string $attribute, mixed $value, Closure $fail): void // Method Laravel calls to run the rule.
    {
        if (!$this-&gt;passes($attribute, $value)) { // Checks whether the value fails the size validation.
            $fail($this-&gt;message()); // Marks validation as failed and provides the error message.
        }
    }
}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #616E88">// Starts the PHP file.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">namespace</span><span style="color: #D8DEE9FF"> App</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Rules</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Places this class in the App\Rules namespace.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">use</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">Closure</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Imports the Closure type used for Laravel&#39;s $fail callback.</span></span>
<span class="line"><span style="color: #81A1C1">use</span><span style="color: #D8DEE9FF"> Illuminate</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Contracts</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Validation</span><span style="color: #ECEFF4">\</span><span style="color: #8FBCBB">ValidationRule</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Imports Laravel&#39;s validation rule interface.</span></span>
<span class="line"><span style="color: #81A1C1">use</span><span style="color: #D8DEE9FF"> Illuminate</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Http</span><span style="color: #ECEFF4">\</span><span style="color: #8FBCBB">UploadedFile</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Imports Laravel&#39;s uploaded file class.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">readonly</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">MaxTotalFileSize</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">implements</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB; font-weight: bold">ValidationRule</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Defines a readonly custom validation rule.</span></span>
<span class="line"><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">__construct</span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Creates the rule with its required configuration.</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">private</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">int</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">maximumBytes</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Maximum allowed combined file size in bytes.</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">private</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">string</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">formattedMaximum</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Human-readable maximum size, e.g. &quot;10 MB&quot;.</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">passes</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">string</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">attribute</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">mixed</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">value</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">bool</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Checks whether the files pass the size limit.</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">!</span><span style="color: #88C0D0">is_array</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">value</span><span style="color: #ECEFF4">))</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// If the validated value is not an array...</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">true;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// ...this rule does not consider it invalid.</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">totalBytes</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">array_sum</span><span style="color: #ECEFF4">(</span><span style="color: #88C0D0">array_map</span><span style="color: #ECEFF4">(</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Calculates the total size of all uploaded files.</span></span>
<span class="line"><span style="color: #88C0D0">            </span><span style="color: #81A1C1">static</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">fn</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">mixed</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">file</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">int</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">file</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">instanceof</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">UploadedFile</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks if the item is an uploaded file.</span></span>
<span class="line"><span style="color: #88C0D0">                </span><span style="color: #81A1C1">?</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">int</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">file</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getSize</span><span style="color: #ECEFF4">()</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// If yes, use its size in bytes.</span></span>
<span class="line"><span style="color: #88C0D0">                </span><span style="color: #81A1C1">:</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">0</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// If not, count its size as zero.</span></span>
<span class="line"><span style="color: #88C0D0">            </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">value</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// The array of files to process.</span></span>
<span class="line"><span style="color: #88C0D0">        </span><span style="color: #ECEFF4">))</span><span style="color: #81A1C1">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">totalBytes</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">maximumBytes</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Passes if the total size is within the limit.</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">message</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">string</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Builds the validation error message.</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">trans</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">validation.attachments_total_size_max</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Loads the translated validation message.</span></span>
<span class="line"><span style="color: #88C0D0">            </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">size</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">formattedMaximum</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Replaces the :size placeholder with the formatted maximum.</span></span>
<span class="line"><span style="color: #88C0D0">        </span><span style="color: #ECEFF4">&#93;)</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">validate</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">string</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">attribute</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">mixed</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">value</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">Closure</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">fail</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">void</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Method Laravel calls to run the rule.</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">!$this-&gt;</span><span style="color: #88C0D0">passes</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">attribute</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">value</span><span style="color: #ECEFF4">))</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Checks whether the value fails the size validation.</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">fail</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #88C0D0">message</span><span style="color: #ECEFF4">())</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Marks validation as failed and provides the error message.</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The next step was to implement or well call this validation where we want it. In this instance those are the 4 forms or well to clarify its 5 files but both admin forms use the crated from the same template forms so the ones where the new validation needs to be implemented is only 3 files: &#8220;AnswerForm.php&#8221;(template for both admin), &#8220;TicketCreate.php&#8221; and &#8220;Ticket.php&#8221;. What we needed to change in the specific admin forms were the rules and remove the old error message.<br>Here&#8217;s what was added:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="if ($property === 'tempUploads') { // Only run this logic when the tempUploads property changes.
    $this-&gt;resetErrorBag(&#91;'tempUploads', 'form.files', 'form.files.*'&#93;); // Clears previous validation errors for these file fields.

    $candidateFiles = &#91; // Creates a new array containing all existing and newly uploaded files.
        ...$this-&gt;form-&gt;files, // Adds the files that are already stored in the form.
        ...$this-&gt;tempUploads, // Adds the newly selected temporary uploads.
    &#93;;

    $rule = new MaxTotalFileSize(20 * 1024 * 1024, '20 MB'); // Creates the custom rule with a maximum total size of 20 MB.

    if (!$rule-&gt;passes('form.files', $candidateFiles)) { // Checks whether all files together exceed the 20 MB limit.
        $this-&gt;addError('tempUploads', $rule-&gt;message()); // Adds the rule's validation error to tempUploads.
        $this-&gt;reset('tempUploads'); // Removes the newly selected temporary uploads.

        return; // Stops execution so the oversized files are not added to the form.
    }

    $this-&gt;form-&gt;files = $candidateFiles; // Saves the combined file list because it passed validation.
    $this-&gt;reset('tempUploads'); // Clears the temporary uploads after moving them into form.files.
}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">property</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">===</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Only run this logic when the tempUploads property changes.</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #88C0D0">resetErrorBag</span><span style="color: #ECEFF4">(&#91;</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">form.files</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">form.files.*</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">&#93;)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Clears previous validation errors for these file fields.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">candidateFiles</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Creates a new array containing all existing and newly uploaded files.</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">...$this-&gt;</span><span style="color: #D8DEE9">form</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">files</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Adds the files that are already stored in the form.</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">...$this-&gt;</span><span style="color: #D8DEE9">tempUploads</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Adds the newly selected temporary uploads.</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">rule</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">new</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">MaxTotalFileSize</span><span style="color: #ECEFF4">(</span><span style="color: #B48EAD">20</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">*</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">1024</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">*</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">1024</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">20 MB</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Creates the custom rule with a maximum total size of 20 MB.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">!$</span><span style="color: #D8DEE9">rule</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">passes</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">form.files</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">candidateFiles</span><span style="color: #ECEFF4">))</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Checks whether all files together exceed the 20 MB limit.</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #88C0D0">addError</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">rule</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">message</span><span style="color: #ECEFF4">())</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Adds the rule&#39;s validation error to tempUploads.</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #88C0D0">reset</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Removes the newly selected temporary uploads.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">return;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Stops execution so the oversized files are not added to the form.</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">form</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">files</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">candidateFiles</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Saves the combined file list because it passed validation.</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #88C0D0">reset</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Clears the temporary uploads after moving them into form.files.</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">With this its mostly done, the remaining things being to adjust the error message display and also since it exists the translations. After adding those it was time to test everything to see if it all works and if so, if it actually does as intended. It now checks directly when uploading the files (also on the admin forms) and if it exceeds the size limit it doesn&#8217;t upload the files and provides the determined error message. If you already uploaded a valid file beforehand that file persists and only the newly &#8220;attempted&#8221; to uploaded files aren&#8217;t added. It also checks again before submitting the form if somehow you manage to bypass the first validation which happens directly when you upload something but if the error persists and you click submit nothing happens (while the error message should already be visible beforehand it would appear anew). So with it all working as intended i decided to split the commits to make it clearer and simpler with the message and the commit itself: one commit was the new custom validation rule class, the second one was the logic for the responding forms and the last one was the adjustment of the translations and the error message displayment. Afterwards like always set the MR to &#8220;To Review&#8221;.</p>



<p class="has-small-font-size wp-block-paragraph">After a bilateral discussion with Simon it turns out that in the myhosttech part, if you add something new you also have to add tests to well, test it. That i didn&#8217;t know and also don&#8217;t know much about pest testing. He also gave me some other information about procedure which i noted. So its time to research about testing with pest in laravel and then proceed with adding the tests for my newly added validation. So i set the MR back to &#8220;Doing&#8221;.</p>



<p class="has-small-font-size wp-block-paragraph">With the new addition of what needed to be done i went back to work and started with educating myself about pest tests and how that whole thing works. As discussed with Simon i started with the &#8220;Pest From Scratch&#8221; Laracasts Series: <a href="https://laracasts.com/series/pest-from-scratch">https://laracasts.com/series/pest-from-scratch</a>.<br>There it was just what pest tests are, what they can actually all do and how they differ from the normal Unit tests (as Pest is basically an extension built on top of Unit).<br>During the Series i had the project open locally and just looked if things were familiar or if they differed how and so, to create a general overview. </p>



<p class="has-small-font-size wp-block-paragraph">After i finished the series i took a closer look at existing project test files mainly tests that were already there for testing the ticket system and the old file size check. Firstly i needed to think about what i needed to do or well more so what the test needed to accomplish. That being 6 checks at 2 different instances each for 4 forms as a rough base form.  Here are the different parts:</p>



<p class="has-small-font-size wp-block-paragraph">6 Checks:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">single file below 20MB</li>



<li class="has-small-font-size">single file exactly 20MB</li>



<li class="has-small-font-size">single file above 20MB</li>



<li class="has-small-font-size">multiple files below 20MB</li>



<li class="has-small-font-size">multiple files exactly 20MB</li>



<li class="has-small-font-size">multiple files above 20MB</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">2 Instances:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">directly when uploading the attachment</li>



<li class="has-small-font-size">when submitting the form</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">4 Forms:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">Admin create Ticket</li>



<li class="has-small-font-size">Admin reply Ticket</li>



<li class="has-small-font-size">Customer create Ticket</li>



<li class="has-small-font-size">Customer reply Ticket</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">As mentioned above this is just the baseline or the foundation of what i will need. So now with the foundation laid out i had to build it. For that i used my knowledge and cross referenced it with other test files to come up with a draft. After i was done with that i asked AI about what tests would all be required to see if im missing some and i was. One of the additional things was checking separate file selections. So when there already is a file uploaded and you select another one, the size of the existing file also needs to count towards the 20MB limit. If the new selection goes over that limit it should be rejected, but the previously accepted file should still persist.</p>



<p class="has-small-font-size wp-block-paragraph">Another part was removing an attachment again. After removing a file the next upload needs to use the new total and an existing error message should disappear. For example if i upload an 11MB file and then try adding a 10MB file, the second selection should fail because together they would be 21MB. If i then remove the 11MB file and upload the 10MB file again, that should work. This also checks that an old error does not remain even though the reason for it is gone.<br>Besides that there were checks for the correct error message and for what happens when submitting invalid attachments. It is not enough that the form shows an error, it also needs to prevent the ticket or reply from being created. For the customer tests this was checked by looking at the amount of tickets or replies in the database before and after the submission. For the admin tests the actions responsible for creating or sending the ticket were mocked, so the test could check whether they were called or not.</p>



<p class="has-small-font-size wp-block-paragraph">For the implementation i ended up with two new test files:</p>



<ul class="wp-block-list has-small-font-size">
<li class="has-small-font-size">&#8211; tests/Rules/MaxTotalFileSizeRuleTest.php</li>



<li class="has-small-font-size">&#8211; tests/Livewire/Ticketsystem/TicketAttachmentSizeTest.php</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">And added the other new tests to two existing files:</p>



<ul class="wp-block-list has-small-font-size">
<li>&#8211; tests/Livewire/Admin/Tickets/AnswerFormTest.php</li>



<li>&#8211; tests/Livewire/Pages/Customer/Ticketsystem/TicketCreateTest.php</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">The rule test checks the MaxTotalFileSize rule itself. So firstly whether it correctly accepts or rejects the combined file size and secondly whether it works when used through Laravel&#8217;s validator, including returning the correct translated<br>error message. The other files test the behaviour through the Livewire components. For the upload tests the files are set through tempUploads, which represents the new file selection. For the submit tests they are set directly through uploads or form.files.<br>That part is important because it means the submit test does not depend on the upload validation already having rejected the files. It checks that the final submission also has its own working validation.</p>



<p class="has-small-font-size wp-block-paragraph">To avoid writing nearly the same test six times i used datasets. A dataset contains the different file sizes and whether that combination should pass or fail. Pest then runs the same test for each of those combinations. The sizes passed to UploadedFile::fake()-&gt;create() are in kilobytes, which is why a 20MB file is written as 20 * 1024. For multiple files it is the combined size that matters, so for example 8MB and 12MB should pass, while 10MB and 11MB should fail.<br><br>With the four forms, the two validation points and the six scenarios that made 48 cases. The direct rule test and the Laravel validator test each also use the six scenarios, adding another 12. Together with the three separate selection and removal tests that resulted in 63 new test cases. The separate selection and removal tests cover admin replies, customer ticket creation and customer replies.dav</p>



<p class="has-small-font-size wp-block-paragraph">When running the tests there were some issues that needed to be looked at before everything could pass. The first one was that the admin form tests failed before they even reached the attachment checks. The form creates a header and footer<br>when it is initialized and the builders responsible for that query ticket_master_lines_view. That view was missing from the local test database.<br>Since the generated header and footer are not what the new attachment tests are meant to check, a helper was added which mocks the four builders and returns a simple test header and footer. The helper is only called in the five new admin attachment tests. It was important to not enable it for every test in the file, because some of the existing tests actually check generated content like salutations. Those would no longer test the real behaviour if the builders were replaced everywhere.<br><br>This did not fix the missing view itself, it just removed that unrelated dependency from the attachment tests. There already is a migration in the project which creates the view. The tests use DatabaseTransactions, which rolls back test data but does not automatically update the database schema. So an outdated test database can still cause these failures. The exact reason why that migration was missing from the local database was not confirmed.</p>



<p class="has-small-font-size wp-block-paragraph">After that the next issue became visible. Some of the new admin ticket submission tests still failed even though the attachment size was valid. The test expected the ticket creation action to be called once, but it was never called. The reason was that the selected category required an email address and the test had not provided one. Adding a valid test email fixed the fixture so the submission could actually reach the action.<br>The successful admin submission assertions were also adjusted to check that there were no validation errors at all, instead of only checking the attachment field. Otherwise an unrelated error like the missing email could be overlooked by that assertion.</p>



<p class="has-small-font-size wp-block-paragraph">One thing that was also checked was whether the fake file sizes survive Livewire&#8217;s temporary upload conversion. Since these are fake files, their actual contents do not need to be 20MB large. Livewire includes the fake size in the temporary filename during tests and reads it back through getSize(). So the size checks still work and there was no need to change how the fake uploads were created.<br><br>After the focused tests passed, running more of the existing tests showed that some of them still expected the old behaviour. One customer ticket creation test uploaded small files together with a roughly 100MB file and then expected the small files to appear in the accepted attachments. With the new total size validation the entire oversized selection is rejected, so that expectation was no longer correct.</p>



<p class="has-small-font-size wp-block-paragraph">That test was adjusted to upload the valid files first and then select the oversized file separately. It now checks that the second selection is rejected while the already accepted files remain. The rest of the test still checks removing an attachment, submitting the ticket and storing the remaining files.<br>There were also smaller changes needed in the old admin attachment test. Previously it expected an error on form.files.3, meaning an error for an individual file. The new rule validates the whole attachment array, so the error is now on form.files. </p>



<p class="has-small-font-size wp-block-paragraph">Another issue in that same test was the index used when removing the oversized file. After removing an earlier file, the component reindexes the array using array_values(). That means the oversized file moves from index 3 to index 2. The test still tried to remove index 3, which would leave the oversized file attached. That second removal was therefore changed to index 2.<br><br>Later the pipeline pointed out two more assertions which still referred to the old file size validation. In tests/Livewire/Ticketsystem/TicketTest.php the oversized upload test expected:<br>&#8211; Maximale erlaubte Dateigrösse: 20 MB<br><br>But the new rule returns:<br>&#8211; Die Anhänge dürfen zusammen maximal 20 MB gross sein.<br><br>The file was still being rejected correctly, it was just the expected text that was outdated. So only that message assertion needed to be changed.<br>The other one was in tests/Data/Tickets/AdminNewTicketFormTest.php. It checked that the form had a custom message for files.*.max. Since the per-file max rule had been replaced by the aggregate rule, that message entry no longer existed. The obsolete assertion was removed, because the new error message comes from MaxTotalFileSize itself and is already covered by the new tests.</p>



<p class="has-small-font-size wp-block-paragraph">The 63 focused tests passed after the setup issues were resolved. The corrected older customer attachment test and the later individual pipeline fixes were also checked separately where possible.<br><br>Something to keep in mind for future endeavours, is that a failing test does not always mean the feature itself is broken. It can also be an incomplete test fixture, an outdated expectation or a missing database dependency. At the same time, passing only the newly added tests does not mean every existing test still works. The older tests also need to be considered, especially when the intended behaviour or error messages have changed. Here&#8217;s is an example of a test file (TicketAttachmentSizeTest.php):</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(3 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;?php

declare(strict_types=1); // Enables strict scalar type checking for calls made from this file.

use App\Enums\Ticket\TicketCustomerStatus; // Imports customer-facing ticket statuses.
use App\Livewire\Ticketsystem\Ticket as TicketComponent; // Imports the Livewire component under a distinct name.
use App\Models\Ticket; // Imports the database model for tickets.
use Illuminate\Http\UploadedFile; // Provides fake uploaded files for testing.
use Illuminate\Support\Facades\Storage; // Provides access to Laravel's storage testing helpers.
use Livewire\Livewire; // Provides Livewire component testing helpers.

beforeEach(function (): void { // Runs this setup before every test, including each dataset case.
  Storage::fake('ticket-items'); // Uses a test filesystem for reply attachments.
  $this-&gt;createCustomer(); // Creates the customer used by the tests.
}); // Ends the shared setup.

dataset('customer ticket reply attachment size scenarios', [ // Defines reusable inputs and expected outcomes.
  'one file below 20 MB' =&gt; [&#91;19 * 1024&#93;, true], // A single 19 MB file should pass; fake file sizes use KB.
  'one file exactly at 20 MB' =&gt; [&#91;20 * 1024&#93;, true], // A single file exactly at the limit should pass.
  'one file above 20 MB' =&gt; [&#91;21 * 1024&#93;, false], // A single 21 MB file should fail.
  'multiple files below 20 MB' =&gt; [&#91;9 * 1024, 10 * 1024&#93;, true], // Files totaling 19 MB should pass.
  'multiple files exactly at 20 MB' =&gt; [&#91;8 * 1024, 12 * 1024&#93;, true], // Files totaling exactly 20 MB should pass.
  'multiple files above 20 MB' =&gt; [&#91;10 * 1024, 11 * 1024&#93;, false], // Files totaling 21 MB should fail.
]); // Ends the dataset.

it('validates the total attachment size while uploading a customer ticket reply', function (array $sizesInKilobytes, bool $shouldPass): void { // Tests immediate upload validation using dataset inputs.
  $ticket = Ticket::factory()-&gt;for($this-&gt;customer)-&gt;create(&#91; // Creates a ticket belonging to this customer.
      'status_customer' =&gt; TicketCustomerStatus::Open, // Makes the ticket open for the customer.
  &#93;); // Saves the ticket.
  $files = collect($sizesInKilobytes) // Starts a collection containing the requested fake file sizes.
      -&gt;map(fn (int $size, int $index): UploadedFile =&gt; UploadedFile::fake()-&gt;create(&quot;attachment-{$index}.zip&quot;, $size, 'application/zip')) // Creates a uniquely named fake ZIP for each size.
      -&gt;all(); // Converts the collection into an array of uploaded files.

  $component = Livewire::actingAs($this-&gt;customer) // Authenticates the test as the ticket's customer.
      -&gt;test(TicketComponent::class, &#91;'ticket' =&gt; $ticket&#93;) // Mounts the reply component with the ticket.
      -&gt;set('tempUploads', $files); // Simulates selecting files and triggers upload validation.

  if ($shouldPass) { // Handles scenarios whose combined size is allowed.
      $component // Continues assertions on the tested component.
          -&gt;assertHasNoErrors('tempUploads') // Checks that the selection has no upload validation error.
          -&gt;assertSet('uploads', fn (array $uploads): bool =&gt; count($uploads) === count($files)) // Checks that the accepted-file count matches the selected-file count.
          -&gt;assertSet('tempUploads', []); // Checks that the temporary selection was cleared after acceptance.

      return; // Ends the valid scenario without running rejection assertions.
  } // Ends the valid-scenario branch.

  $component // Starts assertions for an oversized selection.
      -&gt;assertHasErrors('tempUploads') // Checks that upload validation reported an error.
      -&gt;assertSee('Die Anhänge dürfen zusammen maximal 20 MB gross sein.') // Checks that the translated aggregate-size message is rendered.
      -&gt;assertSet('uploads', []) // Checks that none of this oversized selection was accepted.
      -&gt;assertSet('tempUploads', []); // Checks that the rejected temporary selection was cleared.
})-&gt;with('customer ticket reply attachment size scenarios'); // Runs this test once for each of the six scenarios.

it('includes previous selections and recalculates after removing a reply attachment', function (): void { // Tests cumulative selections and recovery after removal.
  $ticket = Ticket::factory()-&gt;for($this-&gt;customer)-&gt;create(&#91; // Creates a ticket belonging to the customer.
      'status_customer' =&gt; TicketCustomerStatus::Open, // Sets the customer-facing status to open.
  &#93;); // Saves the ticket.
  $firstFile = UploadedFile::fake()-&gt;create('first.zip', 11 * 1024, 'application/zip'); // Creates an 11 MB fake file.
  $secondFile = UploadedFile::fake()-&gt;create('second.zip', 10 * 1024, 'application/zip'); // Creates a 10 MB fake file; together they exceed 20 MB.

  Livewire::actingAs($this-&gt;customer) // Authenticates as the customer.
      -&gt;test(TicketComponent::class, &#91;'ticket' =&gt; $ticket&#93;) // Mounts the component for the customer's ticket.
      -&gt;set('tempUploads', &#91;$firstFile&#93;) // Selects the first file, which is individually within the limit.
      -&gt;assertSet('uploads', fn (array $files): bool =&gt; count($files) === 1) // Checks that one file was accepted.
      -&gt;set('tempUploads', &#91;$secondFile&#93;) // Selects another file while the first remains attached.
      -&gt;assertHasErrors('tempUploads') // Checks that the combined 21 MB total is rejected.
      -&gt;assertSet('uploads', fn (array $files): bool =&gt; count($files) === 1) // Checks that rejection preserves the previous accepted selection.
      -&gt;call('removeFile', 0) // Removes the previously accepted first file.
      -&gt;assertHasNoErrors('tempUploads') // Checks that removal clears the stale upload error.
      -&gt;set('tempUploads', &#91;$secondFile&#93;) // Selects the 10 MB file again, now without the first file.
      -&gt;assertHasNoErrors('tempUploads') // Checks that the reduced total is accepted.
      -&gt;assertSet('uploads', fn (array $files): bool =&gt; count($files) === 1); // Checks that one file is now attached.
}); // Ends the removal and reselection test.

it('validates the total attachment size when submitting a customer ticket reply', function (array $sizesInKilobytes, bool $shouldPass): void { // Tests final submission validation independently of file selection.
  $ticket = Ticket::factory()-&gt;for($this-&gt;customer)-&gt;create(&#91; // Creates a customer-owned ticket for this scenario.
      'status_customer' =&gt; TicketCustomerStatus::Open, // Makes the ticket open for the customer.
  &#93;); // Saves the ticket.
  $files = collect($sizesInKilobytes) // Starts with the sizes supplied by the dataset.
      -&gt;map(fn (int $size, int $index): UploadedFile =&gt; UploadedFile::fake()-&gt;create(&quot;attachment-{$index}.zip&quot;, $size, 'application/zip')) // Creates the fake files with their requested sizes.
      -&gt;all(); // Converts the files into an array.

  $component = Livewire::actingAs($this-&gt;customer) // Authenticates as the ticket's customer.
      -&gt;test(TicketComponent::class, &#91;'ticket' =&gt; $ticket&#93;) // Mounts the reply component.
      -&gt;set('reply', 'Attachment size test') // Supplies valid reply text.
      -&gt;set('uploads', $files) // Sets final attachments directly, bypassing the tempUploads selection check.
      -&gt;call('submitReply'); // Attempts to submit, exercising final validation.

  if ($shouldPass) { // Handles attachments whose total is within the limit.
      $component-&gt;assertHasNoErrors('uploads'); // Checks that final attachment validation succeeds.
      expect($ticket-&gt;items()-&gt;count())-&gt;toBe(1); // Confirms that exactly one ticket item was created.

      return; // Ends the valid scenario.
  } // Ends the valid-scenario branch.

  $component // Starts assertions for an oversized submission.
      -&gt;assertHasErrors('uploads') // Checks that final attachment validation rejects the total.
      -&gt;assertSee('Die Anhänge dürfen zusammen maximal 20 MB gross sein.'); // Checks that the aggregate-size error is displayed.
  expect($ticket-&gt;items()-&gt;count())-&gt;toBe(0); // Confirms that the invalid submission created no ticket item.
})-&gt;with('customer ticket reply attachment size scenarios'); // Runs submission validation for all six scenarios." style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">declare</span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">strict_types</span><span style="color: #81A1C1">=</span><span style="color: #B48EAD">1</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Enables strict scalar type checking for calls made from this file.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">use</span><span style="color: #D8DEE9FF"> App</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Enums</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Ticket</span><span style="color: #ECEFF4">\</span><span style="color: #8FBCBB">TicketCustomerStatus</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Imports customer-facing ticket statuses.</span></span>
<span class="line"><span style="color: #81A1C1">use</span><span style="color: #D8DEE9FF"> App</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Livewire</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Ticketsystem</span><span style="color: #ECEFF4">\</span><span style="color: #8FBCBB">Ticket</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">as</span><span style="color: #D8DEE9FF"> TicketComponent</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Imports the Livewire component under a distinct name.</span></span>
<span class="line"><span style="color: #81A1C1">use</span><span style="color: #D8DEE9FF"> App</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Models</span><span style="color: #ECEFF4">\</span><span style="color: #8FBCBB">Ticket</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Imports the database model for tickets.</span></span>
<span class="line"><span style="color: #81A1C1">use</span><span style="color: #D8DEE9FF"> Illuminate</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Http</span><span style="color: #ECEFF4">\</span><span style="color: #8FBCBB">UploadedFile</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Provides fake uploaded files for testing.</span></span>
<span class="line"><span style="color: #81A1C1">use</span><span style="color: #D8DEE9FF"> Illuminate</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Support</span><span style="color: #ECEFF4">\</span><span style="color: #D8DEE9FF">Facades</span><span style="color: #ECEFF4">\</span><span style="color: #8FBCBB">Storage</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Provides access to Laravel&#39;s storage testing helpers.</span></span>
<span class="line"><span style="color: #81A1C1">use</span><span style="color: #D8DEE9FF"> Livewire</span><span style="color: #ECEFF4">\</span><span style="color: #8FBCBB">Livewire</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Provides Livewire component testing helpers.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">beforeEach</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">function</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">:</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">void</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">{</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Runs this setup before every test, including each dataset case.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #8FBCBB">Storage</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">fake</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">ticket-items</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Uses a test filesystem for reply attachments.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #88C0D0">createCustomer</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Creates the customer used by the tests.</span></span>
<span class="line"><span style="color: #ECEFF4">})</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Ends the shared setup.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">dataset</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">customer ticket reply attachment size scenarios</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">[</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Defines reusable inputs and expected outcomes.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">one file below 20 MB</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">[&#91;</span><span style="color: #B48EAD">19</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">*</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1024</span><span style="color: #ECEFF4">&#93;,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">true</span><span style="color: #ECEFF4">],</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// A single 19 MB file should pass; fake file sizes use KB.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">one file exactly at 20 MB</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">[&#91;</span><span style="color: #B48EAD">20</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">*</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1024</span><span style="color: #ECEFF4">&#93;,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">true</span><span style="color: #ECEFF4">],</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// A single file exactly at the limit should pass.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">one file above 20 MB</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">[&#91;</span><span style="color: #B48EAD">21</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">*</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1024</span><span style="color: #ECEFF4">&#93;,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">false</span><span style="color: #ECEFF4">],</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// A single 21 MB file should fail.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">multiple files below 20 MB</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">[&#91;</span><span style="color: #B48EAD">9</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">*</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1024</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">10</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">*</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1024</span><span style="color: #ECEFF4">&#93;,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">true</span><span style="color: #ECEFF4">],</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Files totaling 19 MB should pass.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">multiple files exactly at 20 MB</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">[&#91;</span><span style="color: #B48EAD">8</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">*</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1024</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">12</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">*</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1024</span><span style="color: #ECEFF4">&#93;,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">true</span><span style="color: #ECEFF4">],</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Files totaling exactly 20 MB should pass.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">multiple files above 20 MB</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">[&#91;</span><span style="color: #B48EAD">10</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">*</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1024</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">11</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">*</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1024</span><span style="color: #ECEFF4">&#93;,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">false</span><span style="color: #ECEFF4">],</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Files totaling 21 MB should fail.</span></span>
<span class="line"><span style="color: #ECEFF4">])</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Ends the dataset.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">it</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">validates the total attachment size while uploading a customer ticket reply</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">function</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">array</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">sizesInKilobytes</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">bool</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">shouldPass</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">void</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">{</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Tests immediate upload validation using dataset inputs.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">ticket</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">Ticket</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">factory</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">for</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">customer</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">create</span><span style="color: #ECEFF4">(&#91;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Creates a ticket belonging to this customer.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">status_customer</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">TicketCustomerStatus</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">Open</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Makes the ticket open for the customer.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #ECEFF4">&#93;)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Saves the ticket.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">files</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=</span><span style="color: #88C0D0"> collect</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">sizesInKilobytes</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Starts a collection containing the requested fake file sizes.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">map</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">fn</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">int</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">size</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">int</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">index</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">UploadedFile</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">UploadedFile</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">fake</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">create</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">attachment-</span><span style="color: #81A1C1">{$</span><span style="color: #D8DEE9">index</span><span style="color: #81A1C1">}</span><span style="color: #A3BE8C">.zip</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">size</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">application/zip</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">))</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Creates a uniquely named fake ZIP for each size.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">all</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Converts the collection into an array of uploaded files.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">component</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">Livewire</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">actingAs</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">customer</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Authenticates the test as the ticket&#39;s customer.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">test</span><span style="color: #ECEFF4">(</span><span style="color: #8FBCBB">TicketComponent</span><span style="color: #81A1C1">::class</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">ticket</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">ticket</span><span style="color: #ECEFF4">&#93;)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Mounts the reply component with the ticket.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">set</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">files</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Simulates selecting files and triggers upload validation.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">if</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">shouldPass</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">{</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Handles scenarios whose combined size is allowed.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">component</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Continues assertions on the tested component.</span></span>
<span class="line"><span style="color: #88C0D0">          </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertHasNoErrors</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that the selection has no upload validation error.</span></span>
<span class="line"><span style="color: #88C0D0">          </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertSet</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">uploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">fn</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">array</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">uploads</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">bool</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">=&gt;</span><span style="color: #88C0D0"> count</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">uploads</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">===</span><span style="color: #88C0D0"> count</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">files</span><span style="color: #ECEFF4">))</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that the accepted-file count matches the selected-file count.</span></span>
<span class="line"><span style="color: #88C0D0">          </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertSet</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">[])</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that the temporary selection was cleared after acceptance.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">return;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Ends the valid scenario without running rejection assertions.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #ECEFF4">}</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Ends the valid-scenario branch.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">component</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Starts assertions for an oversized selection.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertHasErrors</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that upload validation reported an error.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertSee</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">Die Anhänge dürfen zusammen maximal 20 MB gross sein.</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that the translated aggregate-size message is rendered.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertSet</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">uploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">[])</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that none of this oversized selection was accepted.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertSet</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">[])</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that the rejected temporary selection was cleared.</span></span>
<span class="line"><span style="color: #ECEFF4">})</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">with</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">customer ticket reply attachment size scenarios</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Runs this test once for each of the six scenarios.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">it</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">includes previous selections and recalculates after removing a reply attachment</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">function</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">:</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">void</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">{</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Tests cumulative selections and recovery after removal.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">ticket</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">Ticket</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">factory</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">for</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">customer</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">create</span><span style="color: #ECEFF4">(&#91;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Creates a ticket belonging to the customer.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">status_customer</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">TicketCustomerStatus</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">Open</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Sets the customer-facing status to open.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #ECEFF4">&#93;)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Saves the ticket.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">firstFile</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">UploadedFile</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">fake</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">create</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">first.zip</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">11</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">*</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1024</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">application/zip</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Creates an 11 MB fake file.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">secondFile</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">UploadedFile</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">fake</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">create</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">second.zip</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">10</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">*</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1024</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">application/zip</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Creates a 10 MB fake file; together they exceed 20 MB.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #8FBCBB">Livewire</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">actingAs</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">customer</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Authenticates as the customer.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">test</span><span style="color: #ECEFF4">(</span><span style="color: #8FBCBB">TicketComponent</span><span style="color: #81A1C1">::class</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">ticket</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">ticket</span><span style="color: #ECEFF4">&#93;)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Mounts the component for the customer&#39;s ticket.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">set</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">firstFile</span><span style="color: #ECEFF4">&#93;)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Selects the first file, which is individually within the limit.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertSet</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">uploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">fn</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">array</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">files</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">bool</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">=&gt;</span><span style="color: #88C0D0"> count</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">files</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">===</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that one file was accepted.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">set</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">secondFile</span><span style="color: #ECEFF4">&#93;)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Selects another file while the first remains attached.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertHasErrors</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that the combined 21 MB total is rejected.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertSet</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">uploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">fn</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">array</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">files</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">bool</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">=&gt;</span><span style="color: #88C0D0"> count</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">files</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">===</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that rejection preserves the previous accepted selection.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">call</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">removeFile</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">0</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Removes the previously accepted first file.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertHasNoErrors</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that removal clears the stale upload error.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">set</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">secondFile</span><span style="color: #ECEFF4">&#93;)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Selects the 10 MB file again, now without the first file.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertHasNoErrors</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">tempUploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that the reduced total is accepted.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertSet</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">uploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">fn</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">array</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">files</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">bool</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">=&gt;</span><span style="color: #88C0D0"> count</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">files</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">===</span><span style="color: #88C0D0"> </span><span style="color: #B48EAD">1</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that one file is now attached.</span></span>
<span class="line"><span style="color: #ECEFF4">})</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Ends the removal and reselection test.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">it</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">validates the total attachment size when submitting a customer ticket reply</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">function</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">array</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">sizesInKilobytes</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">bool</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">shouldPass</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">void</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">{</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Tests final submission validation independently of file selection.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">ticket</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">Ticket</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">factory</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">for</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">customer</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">create</span><span style="color: #ECEFF4">(&#91;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Creates a customer-owned ticket for this scenario.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">status_customer</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">TicketCustomerStatus</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">Open</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Makes the ticket open for the customer.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #ECEFF4">&#93;)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Saves the ticket.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">files</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=</span><span style="color: #88C0D0"> collect</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">sizesInKilobytes</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Starts with the sizes supplied by the dataset.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">map</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">fn</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">int</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">size</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">int</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">index</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">:</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">UploadedFile</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">UploadedFile</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">fake</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">create</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">attachment-</span><span style="color: #81A1C1">{$</span><span style="color: #D8DEE9">index</span><span style="color: #81A1C1">}</span><span style="color: #A3BE8C">.zip</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">size</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">application/zip</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">))</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Creates the fake files with their requested sizes.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">all</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Converts the files into an array.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">component</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=</span><span style="color: #88C0D0"> </span><span style="color: #8FBCBB">Livewire</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">actingAs</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">customer</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Authenticates as the ticket&#39;s customer.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">test</span><span style="color: #ECEFF4">(</span><span style="color: #8FBCBB">TicketComponent</span><span style="color: #81A1C1">::class</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">ticket</span><span style="color: #ECEFF4">&#39;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">ticket</span><span style="color: #ECEFF4">&#93;)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Mounts the reply component.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">set</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">reply</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">Attachment size test</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Supplies valid reply text.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">set</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">uploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">files</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Sets final attachments directly, bypassing the tempUploads selection check.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">call</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">submitReply</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Attempts to submit, exercising final validation.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">if</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">shouldPass</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #ECEFF4">{</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Handles attachments whose total is within the limit.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">component</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertHasNoErrors</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">uploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that final attachment validation succeeds.</span></span>
<span class="line"><span style="color: #88C0D0">      expect</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">ticket</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">items</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">count</span><span style="color: #ECEFF4">())</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">toBe</span><span style="color: #ECEFF4">(</span><span style="color: #B48EAD">1</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Confirms that exactly one ticket item was created.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">return;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Ends the valid scenario.</span></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #ECEFF4">}</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Ends the valid-scenario branch.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #88C0D0">  </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">component</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Starts assertions for an oversized submission.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertHasErrors</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">uploads</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that final attachment validation rejects the total.</span></span>
<span class="line"><span style="color: #88C0D0">      </span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">assertSee</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">Die Anhänge dürfen zusammen maximal 20 MB gross sein.</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Checks that the aggregate-size error is displayed.</span></span>
<span class="line"><span style="color: #88C0D0">  expect</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">ticket</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">items</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">count</span><span style="color: #ECEFF4">())</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">toBe</span><span style="color: #ECEFF4">(</span><span style="color: #B48EAD">0</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #88C0D0"> </span><span style="color: #616E88">// Confirms that the invalid submission created no ticket item.</span></span>
<span class="line"><span style="color: #ECEFF4">})</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">with</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">customer ticket reply attachment size scenarios</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// Runs submission validation for all six scenarios.</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Now to note this wasn&#8217;t all done within i git commit but it felt unnecessary to specifically mention it beforehand. Basically every change that was a fix was a commit to see if the test in the Pipeline would pass. But now with the final commit the test job of the pipeline finally passed so that was done. But a final issue persisted, the lint job was still failing. <br>The error that the job returned was one that i saw before, when i asked Simon back then he said its a license issue and that he has to &amp; will take care of it so i thought that it would be the same this time and asked him about what to do. He said that it fails somewhere and should give you a output on what it tried to change. He also said that you can run the commands locally to see if they work. Now i looked through everything displayed from the lint job but couldn&#8217;t see anything noticeable, so i picked out a command: &#8220;composer refactor:annotate&#8221; and let it run locally. Now this command added a new property &amp; method to the managed hosting so i thought that this would fix it, i committed it but the lint job still failed. </p>



<p class="has-small-font-size wp-block-paragraph">Afterwards i went on to research about lint and lint tests / jobs in CI/CD pipelines in git and things regarding to see if i could figure something out. After a while of researching and looking through everything again i decided its not worth spending anymore time trying to figure it out myself, so i went ahead and asked Simon if he had time to look at it with me. He said that he would look so that Marco could take a look at it with me. After looking at it the cause were 2 issues, one with the &#8220;de.js&#8221; and one with the &#8220;ManagedHosting.php&#8221; file. The reason why those come up is because it can&#8217;t do those changes in the pipeline which is why you have to do them locally. The reason for the de.js error, that came up because i adjusted a language file (the new error message i added to &#8220;de_CH/validation.php&#8221; and &#8220;de_DE/validation.php&#8221;). To fix that you have to run this command locally: &#8220;php artisan localization:generate&#8221;. This will add the new message/s to the respective language file (de.js). So if you ever make a change to a language file you need to run said command:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">Bash</span><span role="button" tabindex="0" data-code="php artisan localization:generate" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">php</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">artisan</span><span style="color: #D8DEE9FF"> </span><span style="color: #A3BE8C">localization:generate</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">For the &#8220;ManagedHosting.php&#8221; issue that happened because of the changes i committed from the &#8220;composer refactor:annotate&#8221; command. That being that since there&#8217;s a possibility that some migration files or so are on a different stand locally and on the branch that the command can add something that shouldn&#8217;t be there anymore / yet. So you have to check if what was added actually makes sense, in a way that whether or not you actually did something in that regard. So after reverting that and committing the changes the lint job finally passed and now the whole pipeline was green, with that i was finally able to set it to &#8220;To Review&#8221;.</p>



<p class="has-small-font-size wp-block-paragraph">I got the following comments on the changes during the review. They were mainly about making the code easier to read, avoiding duplicated information and reducing repeated checks in the tests.</p>



<p class="has-small-font-size wp-block-paragraph">The first comment was about the &#8220;MaxTotalFileSize&#8221; rule. Until now the rule received two parameters, the maximum size in bytes and the text used for that size in the error message. So for example the byte value for 20MB and then separately the string &#8220;20 MB&#8221;. The suggestion was to use Laravel&#8217;s &#8220;Number::fileSize()&#8221; to create that string directly from the byte value.<br>That made sense because both parameters represented the same limit, just in different formats. If someone changed the byte value but forgot to adjust the string, the error message could show a different limit than the one actually being checked. With &#8220;Number::fileSize()&#8221; the message is now derived from the actual limit, so the second constructor parameter could be removed. All places which create the rule were then adjusted to only pass the byte value.</p>



<p class="has-small-font-size wp-block-paragraph">The second comment was about how that byte value was written. Before it was calculated using &#8220;20 * 1024 * 1024&#8221;. While that works, you still have to mentally work out what the multiplication represents. The suggestion was to use the project&#8217;s existing &#8220;ByteHelper&#8221; instead:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="new MaxTotalFileSize((int) ByteHelper::convert(20, inputUnit: Unit::MB))" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">new</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">MaxTotalFileSize</span><span style="color: #ECEFF4">((</span><span style="color: #81A1C1">int</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">ByteHelper</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">convert</span><span style="color: #ECEFF4">(</span><span style="color: #B48EAD">20</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> inputUnit</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">Unit</span><span style="color: #81A1C1">::</span><span style="color: #D8DEE9FF">MB</span><span style="color: #ECEFF4">))</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This makes it more obvious that the limit is 20MB. The helper converts it to bytes by default, so the actual limit stays the same. The integer cast keeps the result compatible with the rule&#8217;s integer parameter, since the helper can return either an integer or a float.</p>



<p class="has-small-font-size wp-block-paragraph">It was also mentioned that there is no need to wrap this conversion in &#8220;rescue()&#8221;. The helper can throw an exception for invalid input, but here the value and unit are hardcoded and valid. So adding error handling around that would not be necessary. I made this adjustment at all places where the rule is created, including the rule tests, rather than only at the line where the comment was left.</p>



<p class="has-small-font-size wp-block-paragraph">The third comment was about the datasets. The suggestion was to keep the dataset only in &#8220;MaxTotalFileSizeRuleTest.php&#8221; and use just one case in each of the other attachment size tests. At first i wanted to clarify what was meant by one case and which one would make the most sense.</p>



<p class="has-small-font-size wp-block-paragraph">The idea behind it is that the rule tests already check all six combinations: one file below, exactly at and above 20MB, as well as multiple files with a combined size below, exactly at and above 20MB. Repeating all six combinations through every Livewire form adds more test executions, but mostly checks the same size calculation again.<br>The Livewire tests mainly need to check that each form actually uses the rule at the right time. For that i went with two files of 10MB and 11MB. Each file individually is below the limit, but together they are 21MB and should therefore be rejected. This is a useful case because a single oversized file would also have been rejected by the old per-file validation. With two individually valid files, the test specifically checks that the combined limit is being enforced.</p>



<p class="has-small-font-size wp-block-paragraph">The attachment datasets were therefore removed from the three Livewire test files. Each of the eight upload and submission size tests now creates those two files directly. The dataset parameters and the branches for successful scenarios were removed, leaving the assertions for rejecting the oversized total and displaying the correct error message.<br>The submission tests also still check that nothing is created or sent when the attachments exceed the limit. In the admin tests this is done by checking that the mocked creation or sending action is not called. In the customer tests it is done by checking that the ticket or reply count does not increase.</p>



<p class="has-small-font-size wp-block-paragraph">The separate selection and removal tests were kept as they were. Those check something different from the rule itself, namely whether previously accepted files count towards the total, whether they remain after another selection is rejected and whether removing a file clears the old error and allows another upload.<br>Because of this the number of new test cases went down from 63 to 23. Before there were 48 Livewire size cases, coming from four forms with two validation points and six size scenarios each. Those are now eight cases, one for each form and validation point. The twelve rule cases and the three separate selection and removal cases stayed the same.<br>So the six size scenarios are still covered, but they are now checked at the rule level instead of being repeated through every form. The Livewire tests check the connection between the form and the rule. The older attachment tests were also left in place, so their existing submission coverage remains.</p>



<p class="has-small-font-size wp-block-paragraph">After making the adjustments, formatting was checked with the project&#8217;s Pint configuration and the diff was checked for whitespace issues. Both checks passed.<br>With that i committed the changes made and set it to &#8220;To Review&#8221;.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>New KMU Page with Statamic</title>
		<link>https://flurin-lernjournal.hosttech.ch/new-kmu-page-with-statamic/</link>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Tue, 23 Jun 2026 14:04:47 +0000</pubDate>
				<category><![CDATA[Befehle]]></category>
		<category><![CDATA[Erklärungen]]></category>
		<category><![CDATA[hosttech]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Lernjournal]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://flurin-lernjournal.hosttech.ch/?p=1566</guid>

					<description><![CDATA[The goal is to recreate the new Colocation Homepage in / with Statamic exactly as it is given in Zeplin:&#160;https://zpl.io/ez1Gkyl Here it was also most of the same with the order and the things i did. Here same as before i started with the Statamic part first, where i firstly figured out what i need [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">The goal is to recreate the new Colocation Homepage in / with Statamic exactly as it is given in Zeplin:&nbsp;<a href="https://zpl.io/ez1Gkyl" target="_blank" rel="noreferrer noopener">https://zpl.io/ez1Gkyl</a></p>



<p class="wp-block-paragraph">Here it was also most of the same with the order and the things i did. Here same as before i started with the Statamic part first, where i firstly figured out what i need which was the offers (webhosting, which already exist), the vserver offers and the managed hosting offers.</p>



<p class="wp-block-paragraph">For the other offers i created a new collection for each of them (vServer Offers &amp; Managed Hosting Offers) same as i did with the Webhosting offers (which are just called Offers as at that point in time i didn&#8217;t know that different types of offers will come to existence). For the blueprint i also mostly used the same one as i did for the Webhosting offers with the exception of the Quote (the small text under the price) and the discount part. The reason why i decided to not include the discount feature is mainly to the fact that there wasn&#8217;t an example given in the Zeplin template and that i have no confirmation on what or how exactly it should look like. On top of that it would also be reasonably easy to add even at a later date (hopefully at least) since there is a plausible chance that your able to use the existing discount feature of the webhosting offers. <br>After i was done with the different Offers i created the blueprint for the KMU page inside the Google Ads collection. Then the final steps are to fill in the content for the offers and after the KMU page. For the KMU page at least during the filling of the content of the page i notice bits and pieces that could be optimised or at times completely missing.</p>



<p class="wp-block-paragraph">One thing to note which is special about this page is that there are 3 different offer types you can choose from so i decided to make a selector so you can choose which offers you want which we will be able to utilize in the code later.</p>



<p class="wp-block-paragraph">After that it was time to create the necessary folders &amp; files again. Same as before a KMU folder in the google ads folder and in the sections folder also. And inside there the different sets i created in Statamic. Now asides from 2 things there aren&#8217;t much of any noteworthy elements or parts that i did since a lot of them are just repetition or only some more minor adjustments &amp; tweaks. The 2 parts or well more eloquently put they are 2 sub parts of the same section which is the offers. So the first part is the display of the different offers. Now in Zeplin they are displayed one after another but since it has a small navigation or selector above its rather obvious that it&#8217;s intended that it only displays the selected type of offers (Webhosting, vServer &amp; Managed Hosting). </p>



<p class="wp-block-paragraph">This first part is for checking which type is selected and displaying the corresponding offers so only one of them and the correct one is shown.<br>It contains three tab buttons: Webhosting, vServer, and Managed Hosting. Each button has a data-kmu-tab value, for each corresponding offers. Now parts of the code shown bellow are used for the second part which is for the background but more on that later. This is more so a notice so one doesn&#8217;t get confused.</p>



<p class="wp-block-paragraph">The script first finds every offer section using:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">JavaScript</span><span role="button" tabindex="0" data-code="document.querySelectorAll('&#91;data-kmu-offers&#93;')" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">document</span><span style="color: #ECEFF4">.</span><span style="color: #88C0D0">querySelectorAll</span><span style="color: #D8DEE9FF">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">&#91;data-kmu-offers&#93;</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF">)</span></span></code></pre></div>



<p class="wp-block-paragraph">This makes the code reusable, because it would still work if there were multiple KMU offer sections on the page.</p>



<p class="wp-block-paragraph">Inside each section, it collects:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">JavaScript</span><span role="button" tabindex="0" data-code="const tabs = section.querySelectorAll('&#91;data-kmu-tab&#93;');
const panels = section.querySelectorAll('&#91;data-kmu-panel&#93;');" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">const</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">tabs</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">section</span><span style="color: #ECEFF4">.</span><span style="color: #88C0D0">querySelectorAll</span><span style="color: #D8DEE9FF">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">&#91;data-kmu-tab&#93;</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #81A1C1">const</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">panels</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">section</span><span style="color: #ECEFF4">.</span><span style="color: #88C0D0">querySelectorAll</span><span style="color: #D8DEE9FF">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">&#91;data-kmu-panel&#93;</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF">)</span><span style="color: #81A1C1">;</span></span></code></pre></div>



<p class="wp-block-paragraph">The tabs are the clickable buttons. The panels are the content areas for each offer variant. Each panel has a matching value like:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">JavaScript</span><span role="button" tabindex="0" data-code="data-kmu-panel=&quot;webhosting&quot;
data-kmu-panel=&quot;vserver&quot;
data-kmu-panel=&quot;mh&quot;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">data</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">kmu</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">panel</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">webhosting</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9">data</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">kmu</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">panel</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">vserver</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9">data</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">kmu</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">panel</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mh</span><span style="color: #ECEFF4">&quot;</span></span></code></pre></div>



<p class="wp-block-paragraph">The script also finds the main page wrapper:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">JavaScript</span><span role="button" tabindex="0" data-code="const pageShell = section.closest('main')?.querySelector('&#91;data-kmu-page-shell&#93;');" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">const</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">pageShell</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">section</span><span style="color: #ECEFF4">.</span><span style="color: #88C0D0">closest</span><span style="color: #D8DEE9FF">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">main</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF">)</span><span style="color: #ECEFF4">?.</span><span style="color: #88C0D0">querySelector</span><span style="color: #D8DEE9FF">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">&#91;data-kmu-page-shell&#93;</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF">)</span><span style="color: #81A1C1">;</span></span></code></pre></div>



<p class="wp-block-paragraph">This wrapper is important because it controls the large dark background behind the offers. When a user switches tabs, the page needs to resize the dark background because each offer variant has a different height.</p>



<p class="wp-block-paragraph">The main function is:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">JavaScript</span><span role="button" tabindex="0" data-code="const selectVariant = (variant) =&gt; {
    pageShell?.setAttribute('data-kmu-offer-background', variant);

    tabs.forEach((button) =&gt; {
        button.dataset.active = button.dataset.kmuTab === variant ? 'true' : 'false';
    });

    panels.forEach((panel) =&gt; {
        panel.classList.toggle('hidden', panel.dataset.kmuPanel !== variant);
    });
};" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">const</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">selectVariant</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9">variant</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #D8DEE9">pageShell</span><span style="color: #ECEFF4">?.</span><span style="color: #88C0D0">setAttribute</span><span style="color: #D8DEE9FF">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">data-kmu-offer-background</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">variant</span><span style="color: #D8DEE9FF">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #D8DEE9">tabs</span><span style="color: #ECEFF4">.</span><span style="color: #88C0D0">forEach</span><span style="color: #D8DEE9FF">(</span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9">button</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #D8DEE9">button</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">dataset</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">active</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">button</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">dataset</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">kmuTab</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">===</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">variant</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">true</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">false</span><span style="color: #ECEFF4">&#39;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span><span style="color: #D8DEE9FF">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #D8DEE9">panels</span><span style="color: #ECEFF4">.</span><span style="color: #88C0D0">forEach</span><span style="color: #D8DEE9FF">(</span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9">panel</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #D8DEE9">panel</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">classList</span><span style="color: #ECEFF4">.</span><span style="color: #88C0D0">toggle</span><span style="color: #D8DEE9FF">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">hidden</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">panel</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">dataset</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">kmuPanel</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">!==</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">variant</span><span style="color: #D8DEE9FF">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span><span style="color: #D8DEE9FF">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #ECEFF4">}</span><span style="color: #81A1C1">;</span></span></code></pre></div>



<p class="wp-block-paragraph">When a tab is clicked, this function receives the selected variant, such as vserver. It then updates the page shell attribute:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">JavaScript</span><span role="button" tabindex="0" data-code="data-kmu-offer-background=&quot;vserver&quot;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">data</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">kmu</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">offer</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">background</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">vserver</span><span style="color: #ECEFF4">&quot;</span></span></code></pre></div>



<p class="wp-block-paragraph">That attribute is used by the CSS in kmu.antlers.html to change CSS variables like page height, background height, and curve position (more on this later).</p>



<p class="wp-block-paragraph">The script also updates the active tab styling:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">JavaScript</span><span role="button" tabindex="0" data-code="button.dataset.active = button.dataset.kmuTab === variant ? 'true' : 'false';" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">button</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">dataset</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">active</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">button</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">dataset</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">kmuTab</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">===</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">variant</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">true</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">false</span><span style="color: #ECEFF4">&#39;</span><span style="color: #81A1C1">;</span></span></code></pre></div>



<p class="wp-block-paragraph">In the HTML, the buttons use Tailwind’s data attribute styling:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">JavaScript</span><span role="button" tabindex="0" data-code="data-&#91;active=true&#93;:bg-white
data-&#91;active=true&#93;:text-&#91;#111118&#93;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">data</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">&#91;</span><span style="color: #D8DEE9">active</span><span style="color: #81A1C1">=true</span><span style="color: #D8DEE9FF">&#93;:</span><span style="color: #D8DEE9">bg</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">white</span></span>
<span class="line"><span style="color: #D8DEE9">data</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">&#91;</span><span style="color: #D8DEE9">active</span><span style="color: #81A1C1">=true</span><span style="color: #D8DEE9FF">&#93;:</span><span style="color: #D8DEE9">text</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">&#91;#</span><span style="color: #B48EAD">111118</span><span style="color: #D8DEE9FF">&#93;</span></span></code></pre></div>



<p class="wp-block-paragraph">So when data-active=&#8221;true&#8221;, the selected tab gets a white background and dark text.</p>



<p class="wp-block-paragraph">Finally, the script shows the selected panel and hides the others:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">JavaScript</span><span role="button" tabindex="0" data-code="panel.classList.toggle('hidden', panel.dataset.kmuPanel !== variant);" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">panel</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">classList</span><span style="color: #ECEFF4">.</span><span style="color: #88C0D0">toggle</span><span style="color: #D8DEE9FF">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">hidden</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">panel</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">dataset</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">kmuPanel</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">!==</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">variant</span><span style="color: #D8DEE9FF">)</span><span style="color: #81A1C1">;</span></span></code></pre></div>



<p class="wp-block-paragraph">If the panel does not match the selected variant, it receives the hidden class. If it does match, the hidden class is removed.</p>



<p class="wp-block-paragraph">This part is for the background, since to make the curve possible i had to make the background absolute to fix the positions of the 2 different elements. Now after testing the first part if the elements are correctly displayed according to what&#8217;s selected i noticed that the background doesn&#8217;t match the offers as its supposed to especially so on mobile (since they stack and the vserver offers are therefor a lot longer) i decided to try and make that also adjust according to the selected offers and of course also with the @media query from css to make it responsive.<br><br>Now since i already had the javascript which checks which offers are selected i was able to just adjust the code of that a bit and add the necessary css &amp; adjust the html.</p>



<p class="wp-block-paragraph">The CSS in kmu.antlers.html is mainly responsible for controlling the large dark background area behind the KMU landing page content. </p>



<p class="wp-block-paragraph">The page shell starts like this:</p>



<p class="wp-block-paragraph">The important part is:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">CSS</span><span role="button" tabindex="0" data-code="data-kmu-page-shell
data-kmu-offer-background=&quot;webhosting&quot;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">data-kmu-page-shell</span></span>
<span class="line"><span style="color: #81A1C1">data-kmu-offer-background</span><span style="color: #D8DEE9FF">=&quot;webhosting&quot;</span></span></code></pre></div>



<p class="wp-block-paragraph">This element acts as the main visual container for the top part of the page. By default, it uses the webhosting layout.</p>



<p class="wp-block-paragraph">The CSS defines custom properties:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">CSS</span><span role="button" tabindex="0" data-code="--kmu-page-min-height
--kmu-background-height
--kmu-curve-top" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">--kmu-page-min-height</span></span>
<span class="line"><span style="color: #D8DEE9FF">--kmu-background-height</span></span>
<span class="line"><span style="color: #D8DEE9FF">--kmu-curve-top</span></span></code></pre></div>



<p class="wp-block-paragraph">These variables are then used later in the HTML:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">HTML</span><span role="button" tabindex="0" data-code="min-h-&#91;var(--kmu-page-min-height)&#93;
h-&#91;var(--kmu-background-height)&#93;
top-&#91;var(--kmu-curve-top)&#93;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">min-h-&#91;var(--kmu-page-min-height)&#93;</span></span>
<span class="line"><span style="color: #D8DEE9FF">h-&#91;var(--kmu-background-height)&#93;</span></span>
<span class="line"><span style="color: #D8DEE9FF">top-&#91;var(--kmu-curve-top)&#93;</span></span></code></pre></div>



<p class="wp-block-paragraph">So instead of hardcoding the height in many different places, the template defines the values once and reuses them.</p>



<p class="wp-block-paragraph">The reason there are different values for webhosting, vserver, and mh is that each offer tab has a different amount of content. For example, the vserver section is taller than mh, so the dark background needs to stay visible<br>for longer.</p>



<p class="wp-block-paragraph">The JavaScript changes this attribute:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">JavaScript</span><span role="button" tabindex="0" data-code="data-kmu-offer-background=&quot;vserver&quot;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">data</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">kmu</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">offer</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">background</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">vserver</span><span style="color: #ECEFF4">&quot;</span></span></code></pre></div>



<p class="wp-block-paragraph">Then this CSS selector becomes active:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">CSS</span><span role="button" tabindex="0" data-code="&#91;data-kmu-page-shell&#93;&#91;data-kmu-offer-background=&quot;vserver&quot;&#93;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">&#91;</span><span style="color: #8FBCBB">data-kmu-page-shell</span><span style="color: #ECEFF4">&#93;&#91;</span><span style="color: #8FBCBB">data-kmu-offer-background</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">vserver</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span></span></code></pre></div>



<p class="wp-block-paragraph">That updates the CSS variables, which automatically changes the page height, background height, and curve position.</p>



<p class="wp-block-paragraph">There are also media queries:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">CSS</span><span role="button" tabindex="0" data-code="@media (min-width: 768px) { … }
@media (min-width: 1024px) { … }" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D08770">@media</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9">min-width</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">768</span><span style="color: #81A1C1">px</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> … }</span></span>
<span class="line"><span style="color: #D08770">@media</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9">min-width</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">1024</span><span style="color: #81A1C1">px</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> … }</span></span></code></pre></div>



<p class="wp-block-paragraph">These define different height values for tablet and desktop screen sizes. This is needed because the offer cards change layout responsively. On mobile, cards stack vertically and need more height. On desktop, they sit in columns and need less vertical space.</p>



<p class="wp-block-paragraph">The background itself is built from absolute-positioned elements:<br>The first div creates the main dark rectangular background. The second div creates a large rounded oval shape, which makes the bottom edge look curved instead of straight.</p>



<p class="wp-block-paragraph">The selected_offers.antlers.html file renders the offer tabs and all offer panels. Only the selected panel is visible. The JavaScript listens for tab clicks, updates the active tab, hides inactive panels, and changes the page<br>shell’s data-kmu-offer-background attribute.</p>



<p class="wp-block-paragraph">The kmu.antlers.html file reacts to that attribute with CSS. It changes the page height, dark background height, and curved background position depending on whether the user selected Webhosting, vServer, or Managed Hosting.<br>This keeps the visual background aligned with the currently visible offer content.</p>



<p class="wp-block-paragraph">As mentioned above the rest was just more or less the same as before.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>New Webhosting Page with Statamic</title>
		<link>https://flurin-lernjournal.hosttech.ch/new-webhosting-page-with-statamic/</link>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Tue, 26 May 2026 09:42:13 +0000</pubDate>
				<category><![CDATA[Befehle]]></category>
		<category><![CDATA[Erklärungen]]></category>
		<category><![CDATA[hosttech]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Lernjournal]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://flurin-lernjournal.hosttech.ch/?p=1496</guid>

					<description><![CDATA[The goal is to recreate the new Colocation Homepage in / with Statamic exactly as it is given in Zeplin: https://zpl.io/NEBvzY4 This project is very similar to one i&#8217;ve done recently which was to create the new colocation page with Statamic. The only difference is the content &#38; the layout. Which is also why the [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">The goal is to recreate the new Colocation Homepage in / with Statamic exactly as it is given in Zeplin: <a href="https://zpl.io/NEBvzY4">https://zpl.io/NEBvzY4</a></p>



<p class="wp-block-paragraph">This project is very similar to one i&#8217;ve done recently which was to create the new colocation page with Statamic. The only difference is the content &amp; the layout. Which is also why the process and the way i went about it was very similar if not identical at times. So here i also firstly created all the necessary Statamic blueprints and elements i required. Which were the following:</p>



<ul class="wp-block-list">
<li>The webhosting page blueprint</li>



<li>A new collection for the offers</li>



<li>A new blueprint for the offers</li>



<li>Conversion of globals to fieldsets</li>



<li>Desired content for the webshoting page</li>



<li>Desired content for the offers</li>
</ul>



<p class="wp-block-paragraph">The first thing i did is create a new collection for the offers. I decided to do this first because i will need to be able to access the offers in the webhosting blueprint. The one special thing about the offers are that sometimes there will be a discount for an offer and needs to be displayed accordingly where you have to be able to set the discounted price and until when said discount will last. I decided to converse with Manuel on what he thinks is the best way to go about doing this. After the exchange i reached a conclusion on how to do it which was to just create a text &amp; date field to then later check if its filled and add the necessary design changed compared to a normal offer. <br>After the blueprint was done i created the 4 entries in the collection for each offer one entry.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="893" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-offer-bp-1024x893.png" alt="" class="wp-image-1499" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-offer-bp-1024x893.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-offer-bp-300x262.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-offer-bp-768x669.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-offer-bp.png 1216w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">With the offers done i went ahead and created a new blueprint for the webhosting page. For that i went with the same setup as the colocation page, put everything in a replicator field and split the content into different sets / sections. Around mid-way through i noticed that the support card that i need is a global but since i need to be able to use it inside other blueprints i require it to be a fieldset. So to continue i first had to convert the globals i had (the 2 different support / contact cards) into fieldsets. Now there were 2 ways to go about this, the first one is the easy one, it to just recreate the global as a fieldset and then delete the respective global and the second way was to manipulate or well edit the files directly and convert the globals to fieldsets so. I decided to go for the second option because to be quite frank i didn&#8217;t want to create new blueprints since i didn&#8217;t wish to do the work twice. <br>For that i had to go into the respective &#8220;.yaml&#8221; files move them and change the &#8220;designation&#8221; in that sense and also remove the markdown files which were created from the blueprints. With them converted i went back to the webhosting blueprint and finished that. Now all that was left is to fill in the desired content into the page and with that done, i completed the Statamic part of this project. Here are the different sets:</p>



<p class="wp-block-paragraph">Information:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="506" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-information-1024x506.png" alt="" class="wp-image-1500" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-information-1024x506.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-information-300x148.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-information-768x379.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-information-1536x758.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-information.png 1673w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-small-font-size wp-block-paragraph">Blueprint:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="289" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-information-bp-1024x289.png" alt="" class="wp-image-1501" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-information-bp-1024x289.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-information-bp-300x85.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-information-bp-768x217.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-information-bp-1536x434.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-information-bp-2048x578.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Company:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="354" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-company-1024x354.png" alt="" class="wp-image-1502" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-company-1024x354.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-company-300x104.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-company-768x266.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-company-1536x532.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-company.png 1566w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-small-font-size wp-block-paragraph">Blueprint:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="175" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-company-bp-1024x175.png" alt="" class="wp-image-1503" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-company-bp-1024x175.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-company-bp-300x51.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-company-bp-768x132.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-company-bp-1536x263.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-company-bp-2048x351.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Selected Offers:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="666" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-selected_offers-1024x666.png" alt="" class="wp-image-1504" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-selected_offers-1024x666.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-selected_offers-300x195.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-selected_offers-768x500.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-selected_offers-1536x999.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-selected_offers.png 1623w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-small-font-size wp-block-paragraph">Blueprint:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="134" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-selected_offers-bp-1024x134.png" alt="" class="wp-image-1505" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-selected_offers-bp-1024x134.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-selected_offers-bp-300x39.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-selected_offers-bp-768x100.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-selected_offers-bp-1536x201.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-selected_offers-bp-2048x267.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Trust Reason:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="739" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-trust_reason-1024x739.png" alt="" class="wp-image-1506" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-trust_reason-1024x739.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-trust_reason-300x216.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-trust_reason-768x554.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-trust_reason-1536x1108.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-trust_reason.png 1645w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-small-font-size wp-block-paragraph">Blueprint:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="207" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-trust_reason-bp-1024x207.png" alt="" class="wp-image-1507" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-trust_reason-bp-1024x207.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-trust_reason-bp-300x61.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-trust_reason-bp-768x155.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-trust_reason-bp-1536x310.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-trust_reason-bp-2048x413.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Contact:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="729" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-contact-1024x729.png" alt="" class="wp-image-1508" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-contact-1024x729.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-contact-300x214.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-contact-768x547.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-contact-1536x1094.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-contact.png 1587w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-small-font-size wp-block-paragraph">Blueprint:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="98" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-contact-bp-1024x98.png" alt="" class="wp-image-1509" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-contact-bp-1024x98.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-contact-bp-300x29.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-contact-bp-768x73.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-contact-bp-1536x147.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-contact-bp-2048x195.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Comments:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="484" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-comments-1024x484.png" alt="" class="wp-image-1510" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-comments-1024x484.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-comments-300x142.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-comments-768x363.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-comments-1536x726.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-comments.png 1616w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-small-font-size wp-block-paragraph">Blueprint:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="98" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-comments-bp-1024x98.png" alt="" class="wp-image-1511" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-comments-bp-1024x98.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-comments-bp-300x29.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-comments-bp-768x73.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-comments-bp-1536x146.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/05/statamic-webhosting-comments-bp-2048x195.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">With all the Statamic parts done its once more time for the code. I started here with a simple layout where i could see &amp; test if all the elements are bound to Statamic correctly as well. After confirming that everything&#8217;s able to be displayed i went and refined the layout to make it look accordingly as to what is given in Zeplin. A good few elements were similar to what i&#8217;ve done or used for the colocation page so i was able to use those as a reference to assist me. With that the curve at the bottom or the image gradient that i struggled with before were much easier to do. I still encountered some slight problems with the image gradients but i was able to deal with them in a somewhat swift manner.</p>



<p class="wp-block-paragraph">A new problem that arose with this part was in the selected offers set. As mentioned before the discount offer is to be displayed differently to the normal one, it has a red border with a banner at the top and the price is different. The problem with that is that it changes the dimensions of the card which caused for the cards to collide in the mobile views or just shift the card a bit so it wasn&#8217;t properly aligned with the others offers anymore. I thought of 3 different ways to achieve the desired result. One was to make a border and then add a div at the top that disappears behind the card to make it seem to have a smooth transition, the second was similar but instead for the div at the top to disappear behind is to bend it ( like a concave lense) is so it connects perfectly to the top of the offers and the third one is to create a div that is slightly larger than the offer card (with the banner at the top) and put the offer card inside said div. Now i was thinking of proceeding with either option 1 or 3 because option 2 is just a more difficult version of option1 or not even possible with a bend because of the dimensions of option 1. <br>I decided that i would converse with Manuel again to see which option he thinks is the best or if perhaps one of them aligns with what he used in his project where he did this. As it turns out he was familiar with both options and option 3 is very similar to what he used himself, so i decided that i would try both and see which works better. I opted to try option 1 first because its one that i had a bit less faith in and noticed a problem during experimenting beforehand that will most likely appear with this option. I was able to make it work so it aligns correctly and doesn&#8217;t collide with the other offer cards in the mobile views. But the problem which i mentioned before appeared and that was that there was a color mismatch with the div and the border even though they had the exact same coloring. I do not know why that was the case and neither did Manuel so with that i proceeded with option 3. After implementing that the same problem occurred again with the collision but i was able to fix that after a bit.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="{{ collection:offers sort=&quot;offer_price:asc&quot; }}
    {{ if discount_offer_price }}
        &lt;div class=&quot;relative mt-8 min-h-&#91;520px&#93; rounded-&#91;12px&#93; bg-&#91;#dc0046&#93; md:mt-0 md:h-full&quot;&gt;
            &lt;div class=&quot;absolute inset-x-0 top-&#91;-32px&#93; -z-10 flex h-&#91;44px&#93; items-start justify-center rounded-t-&#91;12px&#93; bg-&#91;#dc0046&#93; px-4 pt-1.5 text-center text-&#91;13px&#93; font-bold text-white&quot;&gt;
                Aktion bis {{ discount_date format=&quot;d.m.Y&quot; }}
            &lt;/div&gt;
  
            &lt;article class=&quot;relative mb-&#91;2px&#93; ml-&#91;2px&#93; mr-&#91;2px&#93; flex min-h-&#91;518px&#93; flex-col rounded-b-&#91;10px&#93; rounded-t-&#91;12px&#93; bg-white p-6 text-&#91;#111118&#93; md:h-&#91;calc(100%-2px)&#93;&quot;&gt;
    {{ else }}
        &lt;article class=&quot;relative flex min-h-&#91;520px&#93; flex-col rounded-&#91;12px&#93; border border-&#91;#e7e8ef&#93; bg-white p-6 text-&#91;#111118&#93; md:h-          full&quot;&gt;
    {{ /if }}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> collection</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">offers sort</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">offer_price:asc</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> discount_offer_price </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">relative mt-8 min-h-&#91;520px&#93; rounded-&#91;12px&#93; bg-&#91;#dc0046&#93; md:mt-0 md:h-full</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute inset-x-0 top-&#91;-32px&#93; -z-10 flex h-&#91;44px&#93; items-start justify-center rounded-t-&#91;12px&#93; bg-&#91;#dc0046&#93; px-4 pt-1.5 text-center text-&#91;13px&#93; font-bold text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                Aktion bis </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> discount_date format</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">d.m.Y</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">article </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">relative mb-&#91;2px&#93; ml-&#91;2px&#93; mr-&#91;2px&#93; flex min-h-&#91;518px&#93; flex-col rounded-b-&#91;10px&#93; rounded-t-&#91;12px&#93; bg-white p-6 text-&#91;#111118&#93; md:h-&#91;calc(100%-2px)&#93;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">article </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">relative flex min-h-&#91;520px&#93; flex-col rounded-&#91;12px&#93; border border-&#91;#e7e8ef&#93; bg-white p-6 text-&#91;#111118&#93; md:h-          full</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;div class=&quot;mt-8&quot;&gt;
    {{ if discount_offer_price }}
        &lt;p class=&quot;-mt-5 text-&#91;13px&#93; text-&#91;#8b8f9b&#93; line-through&quot;&gt;{{ offer_price }} {{ currency }} / Mt.&lt;/p&gt;
        &lt;div class=&quot;flex items-end gap-1&quot;&gt;
            &lt;p class=&quot;text-&#91;34px&#93; font-bold leading-none&quot;&gt;{{ discount_offer_price }}&lt;/p&gt;
            &lt;p class=&quot;text-&#91;12px&#93; text-&#91;#6e7080&#93;&quot;&gt;{{ currency }} / Mt.&lt;/p&gt;
        &lt;/div&gt;
    {{ else }}
        &lt;div class=&quot;flex items-end gap-1&quot;&gt;
            &lt;p class=&quot;text-&#91;34px&#93; font-bold leading-none&quot;&gt;{{ offer_price }}&lt;/p&gt;
            &lt;p class=&quot;text-&#91;12px&#93; text-&#91;#6e7080&#93;&quot;&gt;{{ currency }} / Mt.&lt;/p&gt;
        &lt;/div&gt;
    {{ /if }}
&lt;/div&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mt-8</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> discount_offer_price </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">-mt-5 text-&#91;13px&#93; text-&#91;#8b8f9b&#93; line-through</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> offer_price </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> currency </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF"> Mt</span><span style="color: #81A1C1">.</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">flex items-end gap-1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-&#91;34px&#93; font-bold leading-none</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> discount_offer_price </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-&#91;12px&#93; text-&#91;#6e7080&#93;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> currency </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF"> Mt</span><span style="color: #81A1C1">.</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">flex items-end gap-1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-&#91;34px&#93; font-bold leading-none</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> offer_price </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-&#91;12px&#93; text-&#91;#6e7080&#93;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> currency </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF"> Mt</span><span style="color: #81A1C1">.</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>New Colocation Homepage with Statamic</title>
		<link>https://flurin-lernjournal.hosttech.ch/new-colocation-homepage-with-statamic/</link>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Tue, 14 Apr 2026 10:21:12 +0000</pubDate>
				<category><![CDATA[Befehle]]></category>
		<category><![CDATA[Erklärungen]]></category>
		<category><![CDATA[hosttech]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Lernjournal]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://flurin-lernjournal.hosttech.ch/?p=1471</guid>

					<description><![CDATA[The goal is to recreate the new Colocation Homepage in / with Statamic exactly as it is given in Zeplin: https://zpl.io/30xPRQA Zeplin makes such recreation a easier since you can see the sizes of the different elements and even their HTML and CSS code snippets with an extension you can also see the Tailwind CSS [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">The goal is to recreate the new Colocation Homepage in / with Statamic exactly as it is given in Zeplin: <a href="https://zpl.io/30xPRQA">https://zpl.io/30xPRQA</a></p>



<p class="wp-block-paragraph">Zeplin makes such recreation a easier since you can see the sizes of the different elements and even their HTML and CSS code snippets with an extension you can also see the Tailwind CSS version of the CSS. This makes a big difference because before for the recreation it was mostly guess work and trial &amp; error.</p>



<p class="wp-block-paragraph">I firstly went about creating the necessary elements (pages, blueprints, etc.) in Statamic so when i then program the actual code i can directly see if it works. I wanted to create a new Collection so its more separated from my already existing parts but as i did so i encountered a few issues. The collection didn&#8217;t seem works like i intended which after some fixing attempts and it still not working i decided to go for a different way since its not necessary for it to be its own collection and therefor didn&#8217;t want to waste much time on something marginal. <br><br>After my failed collection attempt i just created a new entry called &#8220;Colocation&#8221; in my existing &#8220;Pages&#8221; collection. That worked as intended, now the next part is the main part which is the blueprint for the Colocation page. Now i decided to create the whole blueprint inside a single replicator field (which i called &#8220;Page Sections&#8221;). I opted for that solution because the page is rather big and would require a lot of different fields that it can look quite cluttered and overwhelming. Inside a replicator field you can add different sections (or called Sets in Statamic) this allows you to split up well different parts / sections of the website. Now i decided to split the first half of the website (since that is the current task) into 4 parts:</p>



<p class="wp-block-paragraph">Information:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="919" height="356" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section.png" alt="" class="wp-image-1473" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section.png 919w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section-300x116.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section-768x298.png 768w" sizes="auto, (max-width: 919px) 100vw, 919px" /></figure>



<p class="wp-block-paragraph">Features:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="915" height="250" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section1.png" alt="" class="wp-image-1474" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section1.png 915w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section1-300x82.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section1-768x210.png 768w" sizes="auto, (max-width: 915px) 100vw, 915px" /></figure>



<p class="wp-block-paragraph">Offers:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="904" height="301" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section2.png" alt="" class="wp-image-1475" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section2.png 904w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section2-300x100.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section2-768x256.png 768w" sizes="auto, (max-width: 904px) 100vw, 904px" /></figure>



<p class="wp-block-paragraph">Video:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="909" height="261" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section3.png" alt="" class="wp-image-1476" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section3.png 909w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section3-300x86.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-section3-768x221.png 768w" sizes="auto, (max-width: 909px) 100vw, 909px" /></figure>



<p class="wp-block-paragraph">Here&#8217;s how the 4 sections look like in Statamic:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="597" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-bp-1024x597.png" alt="" class="wp-image-1472" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-bp-1024x597.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-bp-300x175.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-bp-768x448.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-bp.png 1172w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now i mentioned that this makes it less cluttered and overwhelming this is because now when you edit the page there aren&#8217;t dozens of fields displayed but a single plus button. There you can add the different sections one after another. Another advantage is that with this current set up you can decide if you want all the different sections or not. In this instance it is not required and in the code later then you would need to program it a bit differently if you desire that but its still a nice bonus that one could use if desired. <br><br>Now one could also argue that since you can manually add the different sections and if the code isn&#8217;t made to handle a missing sections that it could then break the code. That is correct in such instance the code would / could break but there are different ways you can go about preventing that. For example you could make the code fine to handle such cases or you could make the fields required which then in turn &#8220;forces&#8221; you to add all the different sections. In this particular case since the goal is to recreate the given website all sections will be used even if not required so (at least for the moment) this issue is negatable.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="492" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-page-1024x492.png" alt="" class="wp-image-1477" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-page-1024x492.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-page-300x144.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-page-768x369.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-page.png 1344w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">The first thing i did in the code is create all the necessary folders &amp; files. These were the following:</p>



<ul class="wp-block-list">
<li>resources/views -&gt; a new folder called &#8220;google_ads&#8221;</li>



<li>resources/views/google_ads -&gt; a new file called &#8220;show.antlers.html&#8221;</li>



<li>resources/views -&gt; a new folder called &#8220;sections&#8221;</li>



<li>resources/views/sections -&gt; 4 files called:
<ul class="wp-block-list">
<li>&#8220;information.antlers.html&#8221;</li>



<li>&#8220;features.antlers.html&#8221;</li>



<li>&#8220;offers.antlers.html&#8221;</li>



<li>&#8220;video.antlers.html&#8221;</li>
</ul>
</li>
</ul>



<p class="wp-block-paragraph">So in the 4 files inside the sections folder are the sets as defined in Statamic. As for the show file that is for displaying to whole page. <br>The first step was just to create some placeholder code that contains just the required to display all the elements that are given in the blueprint in a reasonably visually pleasing &amp; understanding manner for a test. After that i checked if everything loaded correctly and if its able to find everything. During this part i encountered the first hurdle because there were multiple parts which didn&#8217;t want to work and the main one was that it didn&#8217;t show the content at all. I was rather confused since the naming&#8217;s of the Statamic blueprint names/slugs were correct same as my antlers syntax. So i tried to figure out why it wasn&#8217;t working by checking the syntax multiple times trying different methods and all but after a short break i had a hunch that it there might be a name conflict so that antlers doesn&#8217;t know which of the collection or slugs to pick so i created a copy of the whole Statamic site (concerning the Colocation Landing page) with that in mind and that indeed worked which confirmed my hunch. <br>After that was done and I adjusted the code with the now correct corresponding names / slugs i was able to display the things given from Statamic. There were still a few minor issues about an element not displaying but those were pretty easy to fix.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="544" height="714" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-structure.png" alt="" class="wp-image-1489" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-structure.png 544w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-structure-229x300.png 229w" sizes="auto, (max-width: 544px) 100vw, 544px" /></figure>



<p class="wp-block-paragraph">Now that the connection between the code and Statamic is working properly im able to dedicate my attention towards the actual design of the page.<br>I moved from the top of the page downward, meaning that i firstly completed the &#8220;information&#8221; set then the &#8220;features&#8221; set after which the &#8220;offers&#8221; set and then finally the &#8220;video&#8221; set. The reason i choose to go in that order (since it is grouped into smaller sections the order wouldn&#8217;t much matter) is for 2 reason: The first reason is that its the order in which i created the sets in Statamic and i like to keep things consistent, The second reason is that it&#8217;s the chronological order of the page, so it felt the most &#8220;natural&#8221;. I choose to follow my &#8220;want&#8221; because it generally makes things easier if your able to do something in a manner which is appealing to oneself. </p>



<p class="wp-block-paragraph">Zeplin made the design optimisation a lot simpler since im able to look at the color hex codes or certain attributes &amp; values compared to having an image which made a lot less reliant on trial &amp; error. It was unusual to work with a tool like that since it was my first time that i did so but not much was required to at least make use of Zeplin for the moment since its a pretty understandable design. During a few instances i asked Manuel for assistance and he was able to show me some tips of what Zeplin can do and how to utilize it. </p>



<p class="wp-block-paragraph">Now after i was done with the design of the different sets it looked alright it was still far from perfect but there was a clear resemblance of what i was given. The main thing that i struggled with was the background at the start of the page. It was rather fragile code since if i changed something it could break quite easily which lead to quite a bit of frustration because even if i changed a part of the code that didn&#8217;t have any direct relation to the background or that part of the background it would still affect it at times. I racked my brain a good bit trying to get it to look accordingly but in the end nothing i tried worked well or well not enough. Now after my vacation after i took another good look at the design in Zeplin and noticed that its not different elements positioned after one another but its layered. Now with that realization i also changed the way which i approached it in the code. In the past the background element were in their respective set but now i moved them to the &#8220;show.antlers.html&#8221; file. Now after a few different tries i was able to make it work.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;div class="pointer-events-none absolute inset-0 z-&#91;1&#93;">
            &lt;div class="absolute inset-x-0 top-0 h-&#91;2110px&#93; bg-&#91;#0d0e1a&#93; md:h-&#91;1710px&#93; lg:h-&#91;1390px&#93;">&lt;/div>
            &lt;div class="absolute left-1/2 top-&#91;1980px&#93; h-&#91;250px&#93; w-&#91;140%&#93; -translate-x-1/2 rounded-&#91;100%&#93; bg-&#91;#0d0e1a&#93; md:top-&#91;1580px&#93; lg:top-&#91;1240px&#93;">&lt;/div>

            {{ page_selections }}
                {{ if type == "information" }}
                    &lt;div class="absolute inset-x-0 top-&#91;59px&#93; h-&#91;640px&#93; overflow-hidden md:h-&#91;720px&#93; lg:h-&#91;768px&#93;">
                        &lt;img
                            src="{{ glide:background_image }}"
                            alt="{{ background_image:alt }}"
                            class="h-full w-full object-fill opacity-100"
                        >
                    &lt;/div>
                {{ /if }}
            {{ /page_selections }}

            &lt;img
                src="/assets/blur-angebote-vdc-colo@3x.webp"
                alt=""
                aria-hidden="true"
                class="absolute left-1/2 top-&#91;1650px&#93; h-&#91;520px&#93; w-&#91;900px&#93; max-w-&#91;calc(100%-2rem)&#93; -translate-x-1/2 opacity-95 object-fill blur-3xl mix-blend-screen md:top-&#91;1320px&#93; md:h-&#91;560px&#93; md:w-&#91;1100px&#93; lg:top-&#91;1020px&#93; lg:h-&#91;628px&#93; lg:w-&#91;1294px&#93; lg:max-w-&#91;calc(100%-3rem)&#93; lg:-translate-x-&#91;48%&#93;"
                style="mask-image: radial-gradient(ellipse at center, #000 0%, #000 46%, transparent 76%), linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%); mask-composite: intersect; -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, #000 46%, transparent 76%), linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%); -webkit-mask-composite: source-in;"
            >
        &lt;/div></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">pointer-events-none absolute inset-0 z-&#91;1&#93;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute inset-x-0 top-0 h-&#91;2110px&#93; bg-&#91;#0d0e1a&#93; md:h-&#91;1710px&#93; lg:h-&#91;1390px&#93;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute left-1/2 top-&#91;1980px&#93; h-&#91;250px&#93; w-&#91;140%&#93; -translate-x-1/2 rounded-&#91;100%&#93; bg-&#91;#0d0e1a&#93; md:top-&#91;1580px&#93; lg:top-&#91;1240px&#93;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> page_selections </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> type </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">information</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute inset-x-0 top-&#91;59px&#93; h-&#91;640px&#93; overflow-hidden md:h-&#91;720px&#93; lg:h-&#91;768px&#93;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img</span></span>
<span class="line"><span style="color: #D8DEE9FF">                            src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ glide:background_image }}</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                            alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ background_image:alt }}</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                            </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">h-full w-full object-fill opacity-100</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">page_selections </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img</span></span>
<span class="line"><span style="color: #D8DEE9FF">                src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">/assets/blur-angebote-vdc-colo@3x.webp</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                aria</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">hidden</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">true</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute left-1/2 top-&#91;1650px&#93; h-&#91;520px&#93; w-&#91;900px&#93; max-w-&#91;calc(100%-2rem)&#93; -translate-x-1/2 opacity-95 object-fill blur-3xl mix-blend-screen md:top-&#91;1320px&#93; md:h-&#91;560px&#93; md:w-&#91;1100px&#93; lg:top-&#91;1020px&#93; lg:h-&#91;628px&#93; lg:w-&#91;1294px&#93; lg:max-w-&#91;calc(100%-3rem)&#93; lg:-translate-x-&#91;48%&#93;</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                style</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mask-image: radial-gradient(ellipse at center, #000 0%, #000 46%, transparent 76%), linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%); mask-composite: intersect; -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, #000 46%, transparent 76%), linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%); -webkit-mask-composite: source-in;</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">Now the general layout of the background looked pretty well but i still had 2 issues. The first was the curve at the bottom and the second is the gradient design (the blue / purple glowing spots behind the offers). I tried a bunch of different things and gradient but in the end nothing worked as i intended. I then asked Manuel for advice and he was able to help me. For the first issue it was that it was a separate element form the existing black background and that its actually wider than the actual screen. The second issue was that its not a gradient or well not as you would normally see but an image which is masked and altered. So he showed me where i can acquire the needed image for the colocation page, which as it turned out was another page in Zeplin. Now with said knowledge in mind i was able to complete the two elements. All that was left now was to optimize 2 elements (mainly the image / gradient). The last thing i did was to implement mobile versions for smaller screens (phone &amp; tablet). <br>There are still differences between what is given in Zeplin and what i created but some are currently unavoidable since for example the icons are difference (since i didn&#8217;t use pro), the font may differ as well or some other minor differences but if looked at with an eye shut then it looks basically the same.  Here&#8217;s what the page looks like:</p>



<figure class="wp-block-image size-large has-custom-border"><img loading="lazy" decoding="async" width="1002" height="1024" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-wesbite-1002x1024.png" alt="" class="wp-image-1485" style="border-width:1px" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-wesbite-1002x1024.png 1002w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-wesbite-293x300.png 293w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-wesbite-768x785.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-wesbite-1502x1536.png 1502w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-wesbite-2003x2048.png 2003w" sizes="auto, (max-width: 1002px) 100vw, 1002px" /></figure>



<p class="wp-block-paragraph">For the second part of the website it was more or less the same. Create new &#8220;Sets&#8221; in the blueprint as required and then add the necessary / desired Fields. The only thing that was special is that the &#8220;Features&#8221; (the original features not the set i created for this website. The small elements with an red-pinkish icon and a text) were a global but since i needed them here as well and in the close future again i had to recreate it as a fieldset so i can use it in other blueprints. Here&#8217;s a reference image:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="654" height="379" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-features-light.png" alt="" class="wp-image-1493" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-features-light.png 654w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-features-light-300x174.png 300w" sizes="auto, (max-width: 654px) 100vw, 654px" /></figure>



<p class="wp-block-paragraph">After that i just added the needed files in the codebase for the newly created sets. For some, like the features (now called &#8220;product_features&#8221; so ones is able to differentiate them) or the &#8220;autoplay_video&#8221; i was able to use existing code since its the same or almost the same. So the only ones i needed to create from a (mostly) blank slate are the &#8220;contact.antlers.html&#8221; amd tje &#8220;reviewer_comment&#8221; files. Those were somewhat simple since i had some references i could use which utilized a similar base. So things weren&#8217;t all that difficult. <br>The element i had the most difficulty implementing is the &#8220;autoplay_video&#8221; one since its a video that auto plays and loops. Now i haven&#8217;t done that ever or well at least in a long time so i had to quickly search for some information on said matter on how to implement something like that. After some short research i had what i needed and programmed it accordingly but the block where the video should&#8217;ve been was just empty as if nothing at all is there. <br><br>After a bit of trials &amp; error and some more research it turns out that i didn&#8217;t have to call the uploaded file (from Statamic) directly but the url of said file. After that it worked nicely. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="374" height="1024" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-part2-374x1024.png" alt="" class="wp-image-1494" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-part2-374x1024.png 374w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/04/statamic-colocation-part2.png 390w" sizes="auto, (max-width: 374px) 100vw, 374px" /></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Statamic Project</title>
		<link>https://flurin-lernjournal.hosttech.ch/statamic-project/</link>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Thu, 12 Feb 2026 10:40:00 +0000</pubDate>
				<category><![CDATA[Befehle]]></category>
		<category><![CDATA[Erklärungen]]></category>
		<category><![CDATA[hosttech]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Lernjournal]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://flurin-lernjournal.hosttech.ch/?p=1351</guid>

					<description><![CDATA[Index Here is an Index of my Statamic project, it doesn&#8217;t always look like this since things might change with updates or because of a different folder structuring by the person themselves. So as mentioned while somethings might align with different projects / versions this is only guaranteed to match my project. (These paths are [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading has-large-font-size">Index</h3>



<p class="wp-block-paragraph">Here is an Index of my Statamic project, it doesn&#8217;t always look like this since things might change with updates or because of a different folder structuring by the person themselves. So as mentioned while somethings might align with different projects / versions this is only guaranteed to match my project. (These paths are all from the project root).</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td>Blueprints</td><td>resources/blueprints</td></tr><tr><td>Users</td><td>users (each user saved as yaml-file)</td></tr><tr><td>Views</td><td>resources/views</td></tr><tr><td>Images </td><td>public/assets &amp; public/img (this isn&#8217;t visible in Statamic)</td></tr><tr><td>Statamic elements (collections, navigations, etc. asides from blueprints)</td><td>content/(assets, collections, globals. navigations, taxonomies, trees)</td></tr><tr><td>Enable Statamic pro for development </td><td>config/statamic/editions.php </td></tr><tr><td>base layout, how the homepage will be built &amp; displayed</td><td>resources/views/layout.antlers.html</td></tr><tr><td>general content of the homepage </td><td>resources/views/home.antlers.html</td></tr><tr><td>default page it reverts to when no content is given</td><td>resources/views/empty.antlers.html</td></tr><tr><td>News page &amp; content</td><td>resources/views/news</td></tr></tbody></table></figure>



<h4 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Glide</h4>



<p class="wp-block-paragraph">Something you will see in the code with images is &#8220;glide&#8221;. Glide is a package used for optimizing and modifying images. You can resize them or add effects like making an image gray, tilting it or so, you can also make it resize on a specified point called the focal-point. So that when the image is resized that the focal point will always be visible. You can choose the focal point in Statamic once you add the image. Here&#8217;s the package: <a href="https://packagist.org/packages/league/glide" target="_blank" rel="noreferrer noopener">Glide Package</a></p>



<h3 class="wp-block-heading" style="font-size:clamp(1.25rem, 1.25rem + ((1vw - 0.2rem) * 1), 2rem);">Project</h3>



<p class="wp-block-paragraph">To learn Statamic i firstly watched the Laracasts Series, <a href="https://laracasts.com/series/learn-statamic-with-jack" target="_blank" rel="noreferrer noopener">Learn Statamic with Jack</a>. After which i recreated the website he used in the series myself. I used Visual Studio Code to built it using HTML &amp; CSS. Now out of habit i used plain CSS instead of Tailwind CSS. This causes me a bit more work since now i have to covert my &#8220;plain CSS&#8221; to Tailwind.<br>Now the next step is to move it all over to the Statamic project which i have in PHPStorm.</p>



<p class="wp-block-paragraph">The first thing that I did is take a quite look around Statamic which is when I saw that there&#8217;s an Update available. After which I updated Statamic from v5.73.5 to version 6.2.3. After the update the Site didn&#8217;t work anymore or at least to a high degree which is when it was decided that I would revert the update back to v5.73.5 where everything was still working as intended. </p>



<h3 class="wp-block-heading has-large-font-size">Homepage</h3>



<p class="wp-block-paragraph">Generally the way I went with working and what I would say is the easiest way to go about working with sometime like this, is to split things up into smaller chunks. Meaning that you don&#8217;t do the whole homepage at once but in parts. So I split the homepage into 4 chunks, the top navigation (main nav), the title (introduction text), the panels and the footer. <br>The first action I took is to separate the main nav and the footer from the homepage and put them in the partials folder and then included them back in the &#8220;layout.antlers.html&#8221; file with antlers &#8220;{{ partial:nav }} &amp; {{ partial:footer }}&#8221;.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;body class=&quot;bg-gray-100 font-sans leading-normal text-gray-500 relative min-h-screen overscroll-none&quot; id=&quot;top&quot;&gt;
    &lt;header class=&quot;max-w-7xl mx-auto&quot;&gt;
        {{ partial:nav }}
    &lt;/header&gt;
    {{ template_content }}
    {{ yield:content }}
    {{ partial:footer }}
    &lt;div class=&quot;absolute z-40 w-full inset-0 opacity-75 pointer-events-none&quot; style=&quot;background: url('/img/film-overlay.png') top center; background-size: 1400px&quot;&gt;&lt;/div&gt;
    &lt;script src=&quot;{{ mix src=&quot;/js/site.js&quot; }}&quot;&gt;&lt;/script&gt;
&lt;/body&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">body </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">bg-gray-100 font-sans leading-normal text-gray-500 relative min-h-screen overscroll-none</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> id</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">top</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">header </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-7xl mx-auto</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">nav </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">header</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> template_content </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">yield:</span><span style="color: #D8DEE9FF">content </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">footer </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute z-40 w-full inset-0 opacity-75 pointer-events-none</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> style</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">background: url(&#39;/img/film-overlay.png&#39;) top center; background-size: 1400px</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">script src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ mix src=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">js</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">site</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">js</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">script</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">body</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<h4 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Title</h4>



<p class="wp-block-paragraph">After that was done I move over to Statamic to create the needed Pages and Blueprints for the given code. The first action was to create the Blueprint for the Lading pages (homepages) which for now only included the title. The title was split into 4 different part in the blueprint, the teaser (small red text at the top) as a normal text field, the title also as a normal text field, a toggle whether you wish to show the lightning bolts and the subtitle as a markdown (since part of the text is bold). These were then added in the code in each respective place inside the &#8220;home.antlers.html&#8221; file.</p>



<p class="wp-block-paragraph">Each of the text added between the curly braces is what we named the different fields in Statamic. This means that the title doesn&#8217;t have to be named that, theoretically you could name it cheese and then add it in the code like so &#8220;title text -&gt; {{ cheese }}&#8221; but it is discouraged since it wouldn&#8217;t make sense and is therefor not understandable.</p>



<ul class="wp-block-list">
<li>teaser text -&gt; {{ teaser }}</li>



<li>title text -&gt; {{ title }}</li>



<li>lightning bolt -&gt; {{ if show_lightning_bolts }}, {{ /if }}</li>



<li>subtitle text -&gt; {{ subtitle }}</li>
</ul>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;section class=&quot;max-w-5xl mx-auto px-4 lg:px-6 py-40 relative hero&quot;&gt;
    &lt;h6 class=&quot;text-red font-bold text-lg antialiased mb-4&quot;&gt;{{ teaser }}&lt;/h6&gt;
    &lt;h1 class=&quot;text-6xl md:text-7xl lg:text-8xl tracking-tight text-white font-bold&quot;&gt;{{ title }}&lt;/h1&gt;
    {{ if show_lightning_bolts }}
    &lt;img src=&quot;/img/lightning-bolts.png&quot; class=&quot;absolute h-64 top-8 right-0&quot; alt=&quot;Lightning Bolts&quot;&gt;
    {{ /if }}
    &lt;div class=&quot;max-w-4xl mt-12 hero-subtitle&quot;&gt;
        {{ subtitle }}
    &lt;/div&gt;
&lt;/section&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">section </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-5xl mx-auto px-4 lg:px-6 py-40 relative hero</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h6 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-red font-bold text-lg antialiased mb-4</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> teaser </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h6</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h1 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-6xl md:text-7xl lg:text-8xl tracking-tight text-white font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h1</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> show_lightning_bolts </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">/img/lightning-bolts.png</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute h-64 top-8 right-0</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Lightning Bolts</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-4xl mt-12 hero-subtitle</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> subtitle </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">section</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<h4 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Panel</h4>



<p class="wp-block-paragraph">The next part of the homepage was the panels, boxes or whatever you wish to call them where one half was an image and the other some text with a button. So naturally that is what i set my sights on next. For that i headed back to the blueprint we created before and added a new field, this time a &#8220;replicator field&#8221; called &#8220;Panels&#8221;. In there i added a set like so:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="293" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-replicator-1024x293.png" alt="" class="wp-image-1356" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-replicator-1024x293.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-replicator-300x86.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-replicator-768x220.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-replicator-1536x439.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-replicator-2048x586.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">After which i went back to the code and created a new file in the partials for panels called &#8220;panels.antlers.html&#8221; and removed the code from the &#8220;home.antlers.html&#8221; file for the panels and moved them into the panels file. Now i needed to enclose all the code between these two &#8220;{{ panels }} &amp; {{ /panels }}&#8221; antlers tags, what this does it creates a loop so it loops over the code for each panel created in Statamic so they look the same. <br>Then i added the different antler tags for the panel itself so the image as an image, teaser as a text, heading as a text, content as a markdown (since its partially bold) and the Button (Call to Action or CTA for short text as a text &amp; link as a link with 50% width each so they fit besides one another).</p>



<ul class="wp-block-list">
<li>background image url -&gt; {{ panel_image }}</li>



<li>teaser text -&gt; {{ panel_teaser }}</li>



<li>heading text -&gt; {{ panel_heading }}</li>



<li>content text -&gt; {{ panel_content }}</li>



<li>a tag, href link -&gt; {{ cta_link }}</li>



<li>link text -&gt; {{ cta_text }}</li>
</ul>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="{{ panels }}
&lt;section class=&quot;max-w-6xl mx-auto p-4 lg:px-6 grid grid-cols-2 gap-8 pb-12 {{ ! first ?= 'mt-32' }}&quot;&gt;
    &lt;div class=&quot;relative {{ index % 2 ?= 'order-last' }}&quot;&gt;
        &lt;div class=&quot;h-&#91;500px&#93; relative z-10 bg-gradient-to-tr from-orange to-blue via-purple rounded-xl bg-cover&quot;&gt;
            &lt;div class=&quot;absolute h-full w-full mix-blend-screen opacity-50 rounded-xl bg-cover&quot; style=&quot;background-image: url('{{ panel_image }}')&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;relative&quot;&gt;
        &lt;div class=&quot;rounded-xl h-&#91;500px&#93; block bg-black/&#91;.8&#93; shadow-glow-red p-8 flex items-center&quot;&gt;
            &lt;div class=&quot;hero&quot;&gt;
                &lt;h6 class=&quot;text-red font-bold text-xl antialiased mb-12&quot;&gt;{{ panel_teaser }}&lt;/h6&gt;
                &lt;h2 class=&quot;text-&#91;32px&#93; tracking-tight leading-tight text-white font-bold&quot;&gt;{{ panel_heading }}&lt;/h2&gt;
                {{ panel_content }}
                &lt;a href=&quot;{{ cta_link }}&quot; class=&quot;mt-12 bg-gradient-to-br from-pink to-purple rounded-lg text-white inline-block py-2 px-6 font-bold shadow-highlight transition hover:scale-&#91;1.05&#93;&quot;&gt;
                    {{ cta_text }}
                &lt;/a&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/section&gt;
{{ /panels }}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> panels </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">section </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-6xl mx-auto p-4 lg:px-6 grid grid-cols-2 gap-8 pb-12 {{ ! first ?= &#39;mt-32&#39; }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">relative {{ index % 2 ?= &#39;order-last&#39; }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">h-&#91;500px&#93; relative z-10 bg-gradient-to-tr from-orange to-blue via-purple rounded-xl bg-cover</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute h-full w-full mix-blend-screen opacity-50 rounded-xl bg-cover</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> style</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">background-image: url(&#39;{{ panel_image }}&#39;)</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">relative</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">rounded-xl h-&#91;500px&#93; block bg-black/&#91;.8&#93; shadow-glow-red p-8 flex items-center</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">hero</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h6 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-red font-bold text-xl antialiased mb-12</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> panel_teaser </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h6</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h2 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-&#91;32px&#93; tracking-tight leading-tight text-white font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> panel_heading </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h2</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> panel_content </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ cta_link }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mt-12 bg-gradient-to-br from-pink to-purple rounded-lg text-white inline-block py-2 px-6 font-bold shadow-highlight transition hover:scale-&#91;1.05&#93;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> cta_text </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">section</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">panels </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="wp-block-paragraph">Now that the panel itself was done i had to add it to the &#8220;home.antlers.html&#8221; file so it would actually be displayed this is done with &#8220;{{ partial:panels }}&#8221;.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);--cbp-line-highlight-color:rgba(201, 218, 248, 0.2);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;section class=&quot;max-w-5xl mx-auto px-4 lg:px-6 py-40 relative hero&quot;&gt;
    &lt;h6 class=&quot;text-red font-bold text-lg antialiased mb-4&quot;&gt;{{ teaser }}&lt;/h6&gt;
    &lt;h1 class=&quot;text-6xl md:text-7xl lg:text-8xl tracking-tight text-white font-bold&quot;&gt;{{ title }}&lt;/h1&gt;
    {{ if show_lightning_bolts }}
    &lt;img src=&quot;/img/lightning-bolts.png&quot; class=&quot;absolute h-64 top-8 right-0&quot; alt=&quot;Lightning Bolts&quot;&gt;
    {{ /if }}
    &lt;div class=&quot;max-w-4xl mt-12 hero-subtitle&quot;&gt;
        {{ subtitle }}
    &lt;/div&gt;
&lt;/section&gt;

{{ partial:panels }}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">section </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-5xl mx-auto px-4 lg:px-6 py-40 relative hero</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h6 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-red font-bold text-lg antialiased mb-4</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> teaser </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h6</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h1 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-6xl md:text-7xl lg:text-8xl tracking-tight text-white font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h1</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> show_lightning_bolts </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">/img/lightning-bolts.png</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute h-64 top-8 right-0</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Lightning Bolts</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-4xl mt-12 hero-subtitle</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> subtitle </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">section</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line cbp-line-highlight"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">panels </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<h4 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Top / Main Navigation </h4>



<p class="wp-block-paragraph">Now since the main content of the homepage is done we can turn our focus to the part that every website needs the navigation. With Statamic there are actually two ways you can create a navigation. We will look at the one where you use the pages to create a navigation. As for the other method, that will be used for the footer navigation.<br>So firstly what needed to be done is add some more pages in our collection. As a baseline for a horizontal navigation at least is to have at least 2 links excluding the home link. This is so that it doesn&#8217;t look so empty or it can also look weird at times.<br>The pages i created are &#8220;News &amp; Press&#8221; (since I will need that later) and &#8220;The Delorean&#8221; just as a placeholder. </p>



<p class="wp-block-paragraph">After that was done it was time to move back to the code base to now create the navigation for or well with the newly created pages. There inside the partials folder in the &#8220;nav.antlers.html&#8221; file i added the antlers tags &#8220;{{ nav:collection:pages }} and {{ /nav:collection:pages }}&#8221; so it takes the pages from the collection in their hierarchical order. Now what i added as future proofing is what to do if a page has child pages that i did with an if check &#8220;{{ if ! children  }}&#8221;, &#8220;{{ else }}&#8221; and &#8220;{{ /if }}&#8221;. Inside there was a loop that just loops over the children and creates a link for each (same as what &#8220;nav:collection:pages&#8221; besides that it&#8217;s only for the children pages of course.). </p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;nav x-data=&quot;{mobileNavOpen: false}&quot;&gt;
    &lt;div class=&quot;p-4 lg:px-6 flex items-center justify-between&quot;&gt;
        &lt;div class=&quot;flex items-center&quot;&gt;
            &lt;a href=&quot;/&quot; class=&quot;font-bold text-3xl text-white p-2 antialiased&quot;&gt;Website&lt;/a&gt;
            &lt;ul class=&quot;hidden lg:flex items-center space-x-4 ml-6&quot;&gt;
                {{ nav:collection:pages }}
                {{ if ! children }}
                &lt;li&gt;&lt;a href=&quot;{{ url }}&quot; class=&quot;p-2 relative hover:text-white transition&quot;&gt;{{ title }}&lt;/a&gt;&lt;/li&gt;
                {{ else }}
                &lt;li class=&quot;group&quot;&gt;
                    &lt;button class=&quot;p-2 relative flex items-center transition group-hover:text-white&quot;&gt;
                        &lt;span&gt;{{ title }}&lt;/span&gt;
                        {{ svg src=&quot;icons/arrow-down&quot; class=&quot;ml-2&quot; }}
                    &lt;/button&gt;
                    &lt;div class=&quot;absolute rounded-lg py-4 -mt-2 px-2 bg-gray-200 hidden group-hover:block&quot;&gt;
                        &lt;ul class=&quot;flex-col&quot;&gt;
                            {{ children }}
                            &lt;li&gt;&lt;a href=&quot;{{ url }}&quot; class=&quot;py-2 px-4 block transition hover:bg-gray-300 rounded hover:text-white&quot;&gt;{{ title }}&lt;/a&gt;&lt;/li&gt;
                            {{ /children }}
                        &lt;/ul&gt;
                    &lt;/div&gt;
                &lt;/li&gt;
                {{ /if }}
                {{ /nav:collection:pages }}
            &lt;/ul&gt;
        &lt;/div&gt;
        &lt;div class=&quot;flex items-center space-x-4 px-2&quot;&gt;
            &lt;a href=&quot;#&quot; class=&quot;hidden md:flex bg-gradient-to-br from-pink to-purple rounded-lg text-white inline-block py-2 px-6 font-bold shadow-highlight transition hover:scale-&#91;1.05&#93;&quot;&gt;
                Book Now
            &lt;/a&gt;
            &lt;button type=&quot;button&quot; class=&quot;lg:hidden p-2 text-white&quot; @click=&quot;mobileNavOpen = ! mobileNavOpen&quot;&gt;
                &lt;svg x-show=&quot;! mobileNavOpen&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;21&quot; width=&quot;21&quot; viewBox=&quot;0 0 21 21&quot;&gt;&lt;g fill=&quot;currentColor&quot; transform=&quot;scale(.875)&quot;&gt;&lt;rect x=&quot;.5&quot; y=&quot;2.5&quot; width=&quot;23&quot; height=&quot;3&quot; rx=&quot;1&quot;/&gt;&lt;rect x=&quot;.5&quot; y=&quot;10.5&quot; width=&quot;23&quot; height=&quot;3&quot; rx=&quot;1&quot;/&gt;&lt;rect x=&quot;.5&quot; y=&quot;18.5&quot; width=&quot;23&quot; height=&quot;3&quot; rx=&quot;1&quot;/&gt;&lt;/g&gt;&lt;/svg&gt;
                &lt;svg x-show=&quot;mobileNavOpen&quot; x-cloak=&quot;true&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; height=&quot;21&quot; width=&quot;21&quot; viewBox=&quot;0 0 21 21&quot;&gt;&lt;g transform=&quot;scale(.875)&quot;&gt;&lt;path fill=&quot;none&quot; stroke=&quot;currentColor&quot; stroke-linecap=&quot;round&quot; stroke-linejoin=&quot;round&quot; stroke-width=&quot;1.5&quot; d=&quot;M.75 23.249l22.5-22.5M23.25 23.249L.75.749&quot;/&gt;&lt;/g&gt;&lt;/svg&gt;
            &lt;/button&gt;
        &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class=&quot;p-2 border-t w-full bg-gray-100 min-h-screen absolute z-30&quot; x-show=&quot;mobileNavOpen&quot; x-cloak x-trap.noscroll=&quot;mobileNavOpen&quot;&gt;
        &lt;ul class=&quot;flex flex-col text-white&quot;&gt;
            &lt;li&gt;&lt;a href=&quot;/&quot; class=&quot;py-2 px-4 block font-bold&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=&quot;#&quot; class=&quot;py-2 px-4 block font-bold&quot;&gt;The Delorean&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href=&quot;#&quot; class=&quot;py-2 px-4 block font-bold&quot;&gt;News &amp; Press&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
&lt;/nav&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">nav x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">data</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{mobileNavOpen: false}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">p-4 lg:px-6 flex items-center justify-between</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">flex items-center</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">/</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">font-bold text-3xl text-white p-2 antialiased</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">Website</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">ul </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">hidden lg:flex items-center space-x-4 ml-6</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> nav</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">collection</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">pages </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">!</span><span style="color: #D8DEE9FF"> children </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">p-2 relative hover:text-white transition</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">li </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">group</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">button </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">p-2 relative flex items-center transition group-hover:text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">span</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">span</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> svg src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">icons/arrow-down</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">ml-2</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">button</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute rounded-lg py-4 -mt-2 px-2 bg-gray-200 hidden group-hover:block</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">ul </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">flex-col</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> children </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">py-2 px-4 block transition hover:bg-gray-300 rounded hover:text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">children </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">ul</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">nav</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">collection</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">pages </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">ul</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">flex items-center space-x-4 px-2</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">#</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">hidden md:flex bg-gradient-to-br from-pink to-purple rounded-lg text-white inline-block py-2 px-6 font-bold shadow-highlight transition hover:scale-&#91;1.05&#93;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                Book Now</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">button type</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">button</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">lg:hidden p-2 text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">@</span><span style="color: #D8DEE9FF">click</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mobileNavOpen = ! mobileNavOpen</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">svg x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">show</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">! mobileNavOpen</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> xmlns</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">http://www.w3.org/2000/svg</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> height</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">21</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> width</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">21</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> viewBox</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">0 0 21 21</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">g fill</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">currentColor</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> transform</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">scale(.875)</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">rect x</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">.5</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> y</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">2.5</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> width</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">23</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> height</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">3</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> rx</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">/&gt;&lt;</span><span style="color: #D8DEE9FF">rect x</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">.5</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> y</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">10.5</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> width</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">23</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> height</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">3</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> rx</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">/&gt;&lt;</span><span style="color: #D8DEE9FF">rect x</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">.5</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> y</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">18.5</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> width</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">23</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> height</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">3</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> rx</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">/&gt;&lt;/</span><span style="color: #D8DEE9FF">g</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">svg</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">svg x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">show</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mobileNavOpen</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">cloak</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">true</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> xmlns</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">http://www.w3.org/2000/svg</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> height</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">21</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> width</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">21</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> viewBox</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">0 0 21 21</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">g transform</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">scale(.875)</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">path fill</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">none</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> stroke</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">currentColor</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> stroke</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">linecap</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">round</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> stroke</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">linejoin</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">round</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> stroke</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">width</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">1.5</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> d</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">M.75 23.249l22.5-22.5M23.25 23.249L.75.749</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">/&gt;&lt;/</span><span style="color: #D8DEE9FF">g</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">svg</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">button</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">p-2 border-t w-full bg-gray-100 min-h-screen absolute z-30</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">show</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mobileNavOpen</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">cloak x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">trap</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">noscroll</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mobileNavOpen</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">ul </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">flex flex-col text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">/</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">py-2 px-4 block font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">Home</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">#</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">py-2 px-4 block font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">The Delorean</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">#</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">py-2 px-4 block font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">News </span><span style="color: #81A1C1">&amp;</span><span style="color: #D8DEE9FF"> Press</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">ul</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">nav</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">Now what I did with the navigation I didn&#8217;t repeat in the mobile nav. That will be adjusted in a bit where i will optimize this also for the mobile view.</p>



<h4 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Footer</h4>



<p class="wp-block-paragraph">The homepage is now almost finished with the only remaining part being the footer. The footer remains mostly unchanged besides for only part which is the footer nav. Now compared to the main nav that we created directly with the pages this footer nav will be done with the Navigation feature from Statamic. For that we go into Statamic to the &#8220;Navigation&#8221; tab and create a new one called &#8220;footer&#8221;, there we can now add nav items those can either be a link to an entry (a existing page) or a specified link (will probably be an external link most of the time since otherwise you can just link to an entry).<br><br>Now it would be a lot easier if we had a toggle option if we want the link to open in a new tab / window. So let&#8217;s create that. For that we create a new blueprint for the footer navigation and add a toggle field called &#8220;Open in a new window&#8221;. After we created and saved everything when we go back to the footer navigation when we add a new Item we can see the toggle option. Now let&#8217;s bind everything together in our code.</p>



<p class="wp-block-paragraph">After we created the desired nav items we go to the &#8220;footer.antlers.html&#8221; file inside the partials folder and add our loop for each nav item which, in this case is &#8220;{{ nav:footer }}&#8221; and &#8220;/nav:footer&#8221;. </p>



<ul class="wp-block-list">
<li>a tag, href link -&gt; {{ url }}</li>



<li>link text -&gt; {{ title }}</li>
</ul>



<p class="wp-block-paragraph">Now aside from these two there is something else to do so the toggle option we created actually functions. For that we add an if &#8220;{{ if external }}&#8221; (external is the handle we gave the toggle field in Statamic) inside the class and then our desired styles (target=&#8221;_blank&#8221; and rel=&#8221;noopener&#8221;) and then close the if &#8220;{{ /if }}&#8221;. So now when the toggle is on then it will apply the given styles inside the if  statement.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;div class=&quot;lg:pl-12&quot;&gt;
                &lt;nav class=&quot;text-lg antialiased -ml-1&quot;&gt;
                    &lt;ul&gt;
                        {{ nav:footer }}
                        &lt;li&gt;&lt;a class=&quot;p-1 inline-block transition hover:text-white&quot; {{ if external }} target=&quot;_blank&quot; rel=&quot;noopener&quot; {{ /if }} href=&quot;{{ url }}&quot;&gt;{{ title }}&lt;/a&gt;&lt;/li&gt;
                        {{ /nav:footer }}
                    &lt;/ul&gt;
                &lt;/nav&gt;
            &lt;/div&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">lg:pl-12</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">nav </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-lg antialiased -ml-1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">ul</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> nav</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">footer </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">a </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">p-1 inline-block transition hover:text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> external </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF"> target</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">_blank</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> rel</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">noopener</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF"> href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">nav</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">footer </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">ul</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">nav</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">As you may see that this is not the whole footer but this is what was changed and made dynamic with Statamic. I decided not to display the rest of the code here since its still the same and would only clutter the space.</p>



<h3 class="wp-block-heading has-large-font-size">News Page</h3>



<p class="wp-block-paragraph">Now that the main page is finished I can get behind the second page that being the news page. Since I already created the page for this I can move on to the next part. The first step is to create a new folder in our views called &#8220;news&#8221; for everything required by the news page. Then a file for the base news page &#8220;index.antlers&#8221; then viewing a single news article &#8220;show.antlers.html&#8221; and finally the card / box which is used to display a single article  &#8220;_card.antlers.html&#8221; the underscore (_) means that its a child file meaning that it is treated the same as if we created a &#8220;partials&#8221; folder and then put a &#8220;card.antlers.html&#8221; file in there. I opted for the underscore option because it will be the only child (partial) used for the news section.</p>



<p class="wp-block-paragraph">Now we can extract the code for the card from the &#8220;index.antlers.html&#8221; file to the &#8220;_card.antlers.html&#8221; file and then include it back in with the antler tag &#8220;{{ partial:news/card }}&#8221;.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);--cbp-line-highlight-color:rgba(201, 218, 248, 0.2);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;header class=&quot;my-12 md:my-16 lg:my-24 text-center&quot;&gt;
    &lt;p class=&quot;text-green font-bold text-lg antialiased mb-4&quot;&gt;News &amp; Press&lt;/p&gt;
    &lt;h1 class=&quot;text-6xl md:text-7xl lg:text-8xl text-white font-bold&quot;&gt;News &amp; Press&lt;/h1&gt;
&lt;/header&gt;

&lt;section class=&quot;grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 max-w-6xl mx-auto gap-x-8 gap-y-16 px-4&quot;&gt;
    {{ partial:news/card}}
&lt;/section&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">header </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">my-12 md:my-16 lg:my-24 text-center</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-green font-bold text-lg antialiased mb-4</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">News </span><span style="color: #81A1C1">&amp;</span><span style="color: #D8DEE9FF"> Press</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h1 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-6xl md:text-7xl lg:text-8xl text-white font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">News </span><span style="color: #81A1C1">&amp;</span><span style="color: #D8DEE9FF"> Press</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h1</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">header</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">section </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 max-w-6xl mx-auto gap-x-8 gap-y-16 px-4</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">news</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">card</span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">section</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<h4 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Title</h4>



<p class="wp-block-paragraph">Now the title is really simple because its just the title text we have to replace which is already included in the base page template in Statamic so basically all i had to do is replace the h1 text with &#8220;{{ title }}&#8221;. </p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;header class=&quot;my-12 md:my-16 lg:my-24 text-center&quot;&gt;
    &lt;p class=&quot;text-green font-bold text-lg antialiased mb-4&quot;&gt;News &amp; Press&lt;/p&gt;
    &lt;h1 class=&quot;text-6xl md:text-7xl lg:text-8xl text-white font-bold&quot;&gt;{{ title }}&lt;/h1&gt;
&lt;/header&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">header </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">my-12 md:my-16 lg:my-24 text-center</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-green font-bold text-lg antialiased mb-4</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">News </span><span style="color: #81A1C1">&amp;</span><span style="color: #D8DEE9FF"> Press</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h1 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-6xl md:text-7xl lg:text-8xl text-white font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h1</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">header</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">The last thing was to tell Statamic which template to use for the &#8220;News &amp; Press&#8221; page, for that you go the the Pages and select the news page and at the bottom you can select the template (its the folder directory from the views folder).</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="662" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-template-1024x662.png" alt="" class="wp-image-1364" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-template-1024x662.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-template-300x194.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-template-768x497.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-template-1536x993.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-template.png 1610w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h4 class="wp-block-heading" style="font-size:clamp(1.039rem, 1.039rem + ((1vw - 0.2rem) * 0.748), 1.6rem);">News Card </h4>



<h4 class="wp-block-heading" style="font-size:clamp(0.957rem, 0.957rem + ((1vw - 0.2rem) * 0.657), 1.45rem);">Index</h4>



<p class="wp-block-paragraph">The first course of action is to create a new collection for the news articles. Now Statamic has a cool way on how you can link the entries of one collection to a page of another entry. So I scrolled all the way down to the &#8220;Routing &amp; URLs&#8221; section and under Mount select the desired entry which is &#8220;News &amp; Press&#8221;.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="792" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mount-1024x792.png" alt="" class="wp-image-1365" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mount-1024x792.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mount-300x232.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mount-768x594.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mount.png 1177w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now what this does, is that now the entries of this collection will be subpages of the selected entry which allows that we can now create &amp; add or edit entries of the &#8220;News Articles&#8221; collection right at the &#8220;News &amp; Press&#8221; entry. Meaning that you don&#8217;t have to navigate around Statamic as much.<br>Now we create a blueprint for the newly created collection with the desired field for the news articles. Those are:<br>A title as a text field, an author as a users field, the featured image as an image and the article text as a bard field.</p>



<p class="wp-block-paragraph">The bard field work a bit similar to the markdown field but it has more customisation capabilities allowing you to add custom block (quotes, galleries, etc.) or other things you desire its also better if you wish to add images between the text or so. That&#8217;s why for the news articles i opted for the bard field. Another thing that i enabled in the bard field is the estimated read time. So one can have a general idea on how long the article takes to read. </p>



<p class="wp-block-paragraph">Now that the blueprint is set I can go back to the &#8220;News Articles&#8221; collection and add the entries. I for now just created 3 which is row (since i put a limited in the code for a max of 3 per column).<br>Now that all those things are done I can return back to the code into the &#8220;_card.antlers.html&#8221; file and link it to Statamic with the antler tags.</p>



<ul class="wp-block-list">
<li>a tag, href link -&gt; {{ url }}</li>



<li>image src -&gt; {{ featured_image }}</li>



<li>title text -&gt; {{ title }}</li>



<li>publish date  -&gt; {{ date }}</li>



<li>author name -&gt; {{ author:name }}</li>
</ul>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;div class=&quot;rounded-xl h-&#91;500px&#93; block bg-gray-200 group flex flex-col hover:scale-105 transition duration-&#91;400ms&#93; ease-in-out&quot;&gt;
    &lt;a href=&quot;{{ url }}&quot; class=&quot;relative overflow-hidden rounded-t-xl&quot;&gt;
        &lt;img class=&quot;object-cover transition duration-&#91;400ms&#93; ease-in-out scale-110 group-hover:scale-100 w-full h-60&quot; src=&quot;{{ glide :src=&quot;featured_image&quot; width=&quot;600&quot; height=&quot;400&quot; fit=&quot;crop_focal&quot; }}&quot; alt=&quot;&quot;&gt;
        &lt;div class=&quot;absolute opacity-0 transition duration-&#91;400ms&#93; ease-in-out group-hover:opacity-75 z-20 inset-0 mix-blend-overlay object-cover w-full h-60 bg-gradient-to-br from-orange-dark to-aqua&quot;&gt;&lt;/div&gt;
    &lt;/a&gt;
    &lt;div class=&quot;px-6 py-8 flex flex-col justify-between flex-1&quot;&gt;
        &lt;h3 class=&quot;font-bold text-2xl text-white&quot;&gt;
            &lt;a href=&quot;{{ url }}&quot; class=&quot;transition hover:text-yellow&quot;&gt;{{ title }}&lt;/a&gt;
        &lt;/h3&gt;
        &lt;div class=&quot;flex items-end justify-between&quot;&gt;
            &lt;div&gt;
                &lt;p&gt;{{ date }}&lt;/p&gt;
                &lt;p class=&quot;text-sm&quot;&gt;By &lt;a href=&quot;&quot; class=&quot;text-gray-700 hover:text-white&quot;&gt;{{ author:name }}&lt;/a&gt;&lt;/p&gt;
            &lt;/div&gt;
            
            &lt;a href=&quot;#&quot; class=&quot;px-3 py-1 text-gray-100 font-bold bg-yellow transition hover:bg-orange rounded-full text-sm&quot;&gt;technology tag&lt;/a&gt;

        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">rounded-xl h-&#91;500px&#93; block bg-gray-200 group flex flex-col hover:scale-105 transition duration-&#91;400ms&#93; ease-in-out</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">relative overflow-hidden rounded-t-xl</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">object-cover transition duration-&#91;400ms&#93; ease-in-out scale-110 group-hover:scale-100 w-full h-60</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ glide :src=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF">featured_image</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> width=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #B48EAD">600</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> height=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #B48EAD">400</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> fit=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF">crop_focal</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute opacity-0 transition duration-&#91;400ms&#93; ease-in-out group-hover:opacity-75 z-20 inset-0 mix-blend-overlay object-cover w-full h-60 bg-gradient-to-br from-orange-dark to-aqua</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">px-6 py-8 flex flex-col justify-between flex-1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h3 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">font-bold text-2xl text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">transition hover:text-yellow</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h3</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">flex items-end justify-between</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> date </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-sm</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">By </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-gray-700 hover:text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> author</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">name </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">#</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">px-3 py-1 text-gray-100 font-bold bg-yellow transition hover:bg-orange rounded-full text-sm</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">technology tag</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">Now the last step for this part is going back to the &#8220;index.antlers.html&#8221; and adding a loop so it shows a card for each news article. For that I add the<br>&#8220;{{ collection:news }}&#8221; and &#8220;{{ /collection:news }}&#8221; antlers tag so it loops over the card displaying one for each entry in the news collection. </p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);--cbp-line-highlight-color:rgba(201, 218, 248, 0.2);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;section class=&quot;grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 max-w-6xl mx-auto gap-x-8 gap-y-16 px-4&quot;&gt;
    {{ collection:news }}
        {{ partial:news/card}}
    {{ /collection:news }}
&lt;/section&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">section </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 max-w-6xl mx-auto gap-x-8 gap-y-16 px-4</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> collection</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">news </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">news</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">card</span><span style="color: #ECEFF4">}}</span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">collection</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">news </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">section</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">Now as a addition to the homepage I added at the bottom a part where the most recent news articles get displayed. This was done basically the same as in the &#8220;News &amp; Press&#8221; page besides that I added a limit to how many articles are shown.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);--cbp-line-highlight-color:rgba(201, 218, 248, 0.2);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;section class=&quot;max-w-5xl mx-auto px-4 lg:px-6 py-40 relative hero&quot;&gt;
    &lt;h6 class=&quot;text-red font-bold text-lg antialiased mb-4&quot;&gt;{{ teaser }}&lt;/h6&gt;
    &lt;h1 class=&quot;text-6xl md:text-7xl lg:text-8xl tracking-tight text-white font-bold&quot;&gt;{{ title }}&lt;/h1&gt;
    {{ if show_lightning_bolts }}
    &lt;img src=&quot;/img/lightning-bolts.png&quot; class=&quot;absolute h-64 top-8 right-0&quot; alt=&quot;Lightning Bolts&quot;&gt;
    {{ /if }}
    &lt;div class=&quot;max-w-4xl mt-12 hero-subtitle&quot;&gt;
        {{ subtitle }}
    &lt;/div&gt;
&lt;/section&gt;

{{ partial:panels }}

&lt;section class=&quot;max-w-6xl mx-auto px-4&quot;&gt;
    &lt;header class=&quot;my-12 md:my-16 lg:my-24 text-center&quot;&gt;
        &lt;h2 class=&quot;text-4xl md:text-5xl lg:text-6xl text-white font-bold&quot;&gt;Latest News&lt;/h2&gt;
    &lt;/header&gt;
    &lt;div class=&quot;grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-16&quot;&gt;
        {{ collection:news limit=&quot;3&quot; }}
        {{ partial:news/card }}
        {{ /collection:news }}
    &lt;/div&gt;
&lt;/section&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">section </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-5xl mx-auto px-4 lg:px-6 py-40 relative hero</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h6 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-red font-bold text-lg antialiased mb-4</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> teaser </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h6</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h1 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-6xl md:text-7xl lg:text-8xl tracking-tight text-white font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h1</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> show_lightning_bolts </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">/img/lightning-bolts.png</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute h-64 top-8 right-0</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Lightning Bolts</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-4xl mt-12 hero-subtitle</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> subtitle </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">section</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">panels </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line cbp-line-highlight"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">section </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-6xl mx-auto px-4</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">header </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">my-12 md:my-16 lg:my-24 text-center</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h2 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-4xl md:text-5xl lg:text-6xl text-white font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">Latest News</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h2</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">header</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-16</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> collection</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">news limit</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">3</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">news</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">card </span><span style="color: #ECEFF4">}}</span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">collection</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">news </span><span style="color: #ECEFF4">}}</span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line cbp-line-highlight"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">section</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<h4 class="wp-block-heading" style="font-size:clamp(0.875rem, 0.875rem + ((1vw - 0.2rem) * 0.567), 1.3rem);">Tags</h4>



<p class="wp-block-paragraph">Now the card is almost done the only thing remaining is the tag/s. For that I go back to Statamic and create a Taxonomy called &#8220;Tags&#8221; after which we create a blueprint for it and add a title as a text field, a content as a markdown field, an author as a users field and a template as a template field.<br>After which I created two Tags &#8220;Team&#8221; and &#8220;Technology&#8221;. <br>Then I went back to the blueprint for the &#8220;News Articles&#8221; collection and in the sidebar added Tags as a terms field (so we can select tags when we create / edit news articles.) and selected the &#8220;Tags&#8221; Taxonomy under Appearance &amp; Behavior where it asks from which taxonomy it should get the terms from. Now i went back to the news articles and edited the entries and added a tag each via the sidebar.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="681" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy2-1024x681.png" alt="" class="wp-image-1366" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy2-1024x681.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy2-300x200.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy2-768x511.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy2-1536x1022.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy2.png 1649w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now the last step for this is to connect my static tag to Statamic so it will be responsive. So in my &#8220;_card.antlers.html&#8221; file for the tag i added the<br>&#8220;{{ tags limit=&#8221;1&#8243; }}&#8221; and &#8220;{{ /tags }}&#8221; and replaced the href with &#8220;{{ url }}&#8221; and the tag name with &#8220;{{ title }}&#8221;.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);--cbp-line-highlight-color:rgba(201, 218, 248, 0.2);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;div class=&quot;flex items-end justify-between&quot;&gt;
            &lt;div&gt;
                &lt;p&gt;{{ date }}&lt;/p&gt;
                &lt;p class=&quot;text-sm&quot;&gt;By &lt;a href=&quot;&quot; class=&quot;text-gray-700 hover:text-white&quot;&gt;{{ author:name }}&lt;/a&gt;&lt;/p&gt;
            &lt;/div&gt;
            
            {{ tags limit=&quot;1&quot; }}
            &lt;a href=&quot;{{ url }}&quot; class=&quot;px-3 py-1 text-gray-100 font-bold bg-yellow transition hover:bg-orange rounded-full text-sm&quot;&gt;{{ title }}&lt;/a&gt;
            {{ /tags }}
        &lt;/div&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">flex items-end justify-between</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> date </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-sm</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">By </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-gray-700 hover:text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> author</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">name </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> tags limit</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">px-3 py-1 text-gray-100 font-bold bg-yellow transition hover:bg-orange rounded-full text-sm</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line cbp-line-highlight"><span style="color: #D8DEE9FF">            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">tags </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<h4 class="wp-block-heading" style="font-size:clamp(0.957rem, 0.957rem + ((1vw - 0.2rem) * 0.657), 1.45rem);">Show</h4>



<p class="wp-block-paragraph">The last step is to create the single article view. Since before for the &#8220;News &amp; Press&#8221; page everything required is already created. So basically all that&#8217;s left is to in infuse the statamic into the existing code. So same as before besides now i also added the article content and the author avatar. I adjusted / added the following:</p>



<ul class="wp-block-list">
<li>static tag/s -&gt; {{ tags }} &amp; {{ /tags }}</li>



<li>a tag, href link -&gt; {{ url }}</li>



<li>title text -&gt; {{ title }}</li>



<li>image src (author) -&gt; {{ author:avatar }}</li>



<li>publish date  -&gt; {{ date }}</li>



<li>author name -&gt; {{ author:name }}</li>



<li>image src (article image) -&gt; {{ featured_image }}</li>



<li>article text -&gt; {{ article_content }}</li>
</ul>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;article class=&quot;max-w-5xl mx-auto px-4 lg:px-6 py-24 relative&quot;&gt;
    &lt;header class=&quot;max-w-3xl mx-auto&quot;&gt;
        {{ tags }}
        &lt;a href=&quot;{{ url }}&quot; class=&quot;px-3 py-1 text-gray-100 font-bold bg-yellow transition hover:bg-orange rounded-full inline-block mb-8&quot;&gt;{{ title }}&lt;/a&gt;
        {{ /tags }}
        &lt;h1 class=&quot;text-5xl md:text-6xl lg:text-7xl tracking-tight text-white font-bold&quot;&gt;{{ title }}&lt;/h1&gt;
        &lt;div class=&quot;flex items-center mt-12&quot;&gt;
            &lt;img class=&quot;rounded-full h-16 w-16&quot; src=&quot;{{ author:avatar }}&quot; alt=&quot;{{ author:avatar:alt }}&quot;&gt;
            &lt;div class=&quot;ml-6&quot;&gt;
                &lt;div&gt;{{ date }}&lt;/div&gt;
                &lt;div&gt;By &lt;a href=&quot;&quot; class=&quot;font-bold text-white&quot;&gt;{{ author:name }}&lt;/a&gt;&lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/header&gt;

    &lt;figure class=&quot;mt-12&quot;&gt;
        &lt;img src=&quot;{{ glide:featured_image width=&quot;1800&quot; height=&quot;1200&quot; }}&quot; alt=&quot;{{ featured_image:alt }}&quot;&gt;
    &lt;/figure&gt;

    &lt;section class=&quot;max-w-3xl mx-auto mt-12 content article&quot;&gt;
        {{ article_content }}
    &lt;/section&gt;
&lt;/article&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">article </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-5xl mx-auto px-4 lg:px-6 py-24 relative</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">header </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-3xl mx-auto</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> tags </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">px-3 py-1 text-gray-100 font-bold bg-yellow transition hover:bg-orange rounded-full inline-block mb-8</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">tags </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h1 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-5xl md:text-6xl lg:text-7xl tracking-tight text-white font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h1</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">flex items-center mt-12</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">rounded-full h-16 w-16</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ author:avatar }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ author:avatar:alt }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">ml-6</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> date </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">By </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">font-bold text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> author</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">name </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">header</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">figure </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mt-12</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ glide:featured_image width=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #B48EAD">1800</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> height=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #B48EAD">1200</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ featured_image:alt }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">figure</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">section </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-3xl mx-auto mt-12 content article</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> article_content </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">section</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">article</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<h3 class="wp-block-heading has-large-font-size">Mobile View</h3>



<p class="wp-block-paragraph">A good website is compatible for all different types of devices even the special ones like the Samsung Z Fold 5 or other smaller / thinner phones or even just a tablet and also ultrawide monitors. But a good starting point is the &#8220;normal&#8221; view so the one on a laptop or normal monitor and then a mobile view, so the one for phones. Though over the years with the invention of phones which kept getting more advanced the &#8220;normal&#8221; view became more and more the mobile view which is why generally you build that one first. Its also the one you generally wish to optimize first since it tends to be more complicated. In my case i went for the most common 3: the phones (small), the tablets(medium / medium-large) <br>and the desktop (large) views.</p>



<h4 class="wp-block-heading" style="font-size:clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.688), 1.5rem);">Navigation</h4>



<p class="wp-block-paragraph">As mentioned before in the main nav section that while i already implemented a mobile version for the navigation I didn&#8217;t yet fuse it with Statamic so that its dynamic. That&#8217;s what i did now. The way to do it is almost identical to the main navigation besides the fact here you add the home link separately because that is not included when you call the pages. </p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;div class=&quot;p-2 border-t w-full bg-gray-100 min-h-screen absolute z-30&quot; x-show=&quot;mobileNavOpen&quot; x-cloak x-trap.noscroll=&quot;mobileNavOpen&quot;&gt;
        &lt;ul class=&quot;flex flex-col text-white&quot;&gt;
            &lt;li&gt;&lt;a href=&quot;/&quot; class=&quot;py-2 px-4 block font-bold&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
            {{ nav:collection:pages }}
            &lt;li&gt;&lt;a href=&quot;{{ url }}&quot; class=&quot;py-2 px-4 block font-bold&quot;&gt;{{ title }}&lt;/a&gt;&lt;/li&gt;
            {{ /nav:collection:pages }}
        &lt;/ul&gt;
    &lt;/div&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">p-2 border-t w-full bg-gray-100 min-h-screen absolute z-30</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">show</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mobileNavOpen</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">cloak x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">trap</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">noscroll</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mobileNavOpen</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">ul </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">flex flex-col text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">/</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">py-2 px-4 block font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">Home</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> nav</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">collection</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">pages </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">py-2 px-4 block font-bold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">nav</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">collection</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">pages </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">ul</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">While this works also for medium screens (tablets) it looks weird in a sense because there is a ton of empty space on the right side. I knew that there was a certain way websites tend to make the navigation for medium screens. That is that it uses only a percentage of the screen instead of the full width. Now i didn&#8217;t fully remember what the general scale is or how its constructed in general so i quickly went to look it up. My first stop was the hosttech page which did have one for medium screen in the same manner i had in mind. So now with a example i did it for my own website. <br><br>For that i needed to limit the width of the nav (for medium screens) which i opted for 2/3 because it looked good. And then the base code made it appear from the left so i had to change that as well. The second step was to add another layer so the main page (in the background when the nav is open) to loose focus. That is usually done by darkening it. I just created a div with a black background and 50% transparency and only make it appear when the nav is open. I used this because its the way i&#8217;ve done so in the past and its also the only way i know how.  </p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;div class=&quot;fixed inset-x-0 bottom-0 md:top-21 bg-black/50 z-20&quot; x-show=&quot;mobileNavOpen&quot; @click=&quot;mobileNavOpen = false&quot; x-cloak&gt;&lt;/div&gt;

&lt;div class=&quot;p-2 border-t w-full bg-gray-100 min-h-screen absolute z-30 md:w-2/3 right-0&quot; x-show=&quot;mobileNavOpen&quot; x-cloak x-trap.noscroll=&quot;mobileNavOpen&quot;&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">fixed inset-x-0 bottom-0 md:top-21 bg-black/50 z-20</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">show</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mobileNavOpen</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">@</span><span style="color: #D8DEE9FF">click</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mobileNavOpen = false</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">cloak</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">p-2 border-t w-full bg-gray-100 min-h-screen absolute z-30 md:w-2/3 right-0</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">show</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mobileNavOpen</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">cloak x</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">trap</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">noscroll</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mobileNavOpen</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-930feb06 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-container-core-column-is-layout-9f91450b wp-block-column-is-layout-flow" style="border-style:none;border-width:0px;padding-top:0;padding-right:0;padding-bottom:0;padding-left:0">
<p class="has-medium-font-size wp-block-paragraph">Before:</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p class="has-medium-font-size wp-block-paragraph">After:</p>
</div>
</div>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="608" height="504" data-id="1389" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mid-screen2.png" alt="" class="wp-image-1389" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mid-screen2.png 608w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mid-screen2-300x249.png 300w" sizes="auto, (max-width: 608px) 100vw, 608px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="601" height="523" data-id="1388" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mid-screen-1.png" alt="" class="wp-image-1388" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mid-screen-1.png 601w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mid-screen-1-300x261.png 300w" sizes="auto, (max-width: 601px) 100vw, 601px" /></figure>
</figure>



<p class="wp-block-paragraph">Yet another change i made is making the text size for the small &amp; medium-large screens (phones &amp; tablets) and add dividers to make the navigation links easier to press and make it visible where each element starts / ends. I did this for accessibility purposes so people with shaky or big hands have an easier time navigating the page. </p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-930feb06 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p class="has-medium-font-size wp-block-paragraph">Small screens (phones): </p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p class="has-medium-font-size wp-block-paragraph">Medium-Large screens (tablets):</p>
</div>
</div>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="385" height="420" data-id="1421" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-nav-new.png" alt="" class="wp-image-1421" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-nav-new.png 385w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-nav-new-275x300.png 275w" sizes="auto, (max-width: 385px) 100vw, 385px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="564" height="491" data-id="1422" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-nav-new1.png" alt="" class="wp-image-1422" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-nav-new1.png 564w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-nav-new1-300x261.png 300w" sizes="auto, (max-width: 564px) 100vw, 564px" /></figure>
</figure>



<p class="wp-block-paragraph">Another thing i did is for small screens make the text size and padding on the x-axis a bit smaller so the text doesn&#8217;t warp and stay on one line.</p>



<h3 class="wp-block-heading has-large-font-size">Main Page</h3>



<h4 class="wp-block-heading" style="font-size:clamp(0.957rem, 0.957rem + ((1vw - 0.2rem) * 0.657), 1.45rem);">Title</h4>



<p class="wp-block-paragraph">The next part was the title, the current problem is that if the screen gets smaller that the image collides and overlaps with the title itself. So to fix that and to make it easier / better for smaller screen i opted for removing the image on the smaller screen. This is so that its less cluttered. <br>Tailwind CSS work with a mobile first system. Meaning that the base build will be for mobile and if you wish to change things you do that after. This is because Tailwind has a way to display something after a certain breakpoint. So when a screen has a certain view size which is above the defined breakpoint then it will add the given styles. <a href="https://tailwindcss.com/docs/responsive-design#targeting-a-breakpoint-range" target="_blank" rel="noreferrer noopener">Tailwind CSS Breakpoints</a></p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="{{ if show_lightning_bolts }}
    &lt;img src=&quot;/img/lightning-bolts.png&quot; class=&quot;hidden lg:block absolute h-64 top-8 right-0&quot; alt=&quot;Lightning Bolts&quot;&gt;
{{ /if }}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> show_lightning_bolts </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">/img/lightning-bolts.png</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">hidden lg:block absolute h-64 top-8 right-0</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">Lightning Bolts</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="wp-block-paragraph">The second part of adjusting the Title was to move the title more inwards so its more centered and the right side doesn&#8217;t look as empty. For that i added extra margin on the left &amp; right side. But i just did that for an medium screens (ipads / tablets) because if it would also have that margin on the small screens  (phones) then its too compressed which makes it look weird. For that i added <em><strong>mx-auto</strong></em> (for small screens), <strong><em>sm:mx-12</em></strong> for medium screens and <strong><em>lg:mx-auto</em></strong> again for large screens.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;section class=&quot;max-w-5xl mx-auto sm:mx-12 lg:mx-auto px-4 lg:px-6 py-20 lg:py-40 relative hero&quot;&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">section </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-5xl mx-auto sm:mx-12 lg:mx-auto px-4 lg:px-6 py-20 lg:py-40 relative hero</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">Output:</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full is-style-default"><img loading="lazy" decoding="async" width="607" height="405" data-id="1393" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/03/statamic-mid-screen1-2-edited.png" alt="" class="wp-image-1393" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/03/statamic-mid-screen1-2-edited.png 607w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/03/statamic-mid-screen1-2-edited-300x200.png 300w" sizes="auto, (max-width: 607px) 100vw, 607px" /></figure>
</figure>



<h4 class="wp-block-heading" style="font-size:clamp(0.957rem, 0.957rem + ((1vw - 0.2rem) * 0.657), 1.45rem);">Panels </h4>



<p class="wp-block-paragraph">The biggest existing issue (besides the image collision with the title) are the panels. That is because there are 2 per column which leads to them being crammed and the text &#8220;glitching&#8221; out of the box. Now the fix for that was to make it only be one box per column. This makes them appear below one another instead of besides making it look nicer without any &#8220;glitches&#8221;. Another thing i did to make it look nicer is reduce the distance between the elements.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;section class=&quot;max-w-6xl mx-auto sm:mx-12 lg:mx-auto p-4 lg:px-6 grid grid-cols-1 lg:grid-cols-2 gap-8 pb-12 {{ ! first ?= 'mt-12 lg:mt-32' }}&quot;&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">section </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-6xl mx-auto sm:mx-12 lg:mx-auto p-4 lg:px-6 grid grid-cols-1 lg:grid-cols-2 gap-8 pb-12 {{ ! first ?= &#39;mt-12 lg:mt-32&#39; }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">The second part was to reduce the height of the panels. Because currently you had to scroll a bit to view them and it just looked too big for the screen. <br>So i just reduced the height.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;div class=&quot;rounded-xl h-&#91;350px&#93; lg:h-&#91;500px&#93; block bg-black/&#91;.8&#93; shadow-glow-red p-8 flex items-center&quot;&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">rounded-xl h-&#91;350px&#93; lg:h-&#91;500px&#93; block bg-black/&#91;.8&#93; shadow-glow-red p-8 flex items-center</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">Now the last step is the same as with the title, to add some  space on the x-axis to make it look nicer. Here also again with a set margin for middle sized screens.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;section class=&quot;max-w-6xl mx-auto sm:mx-12 lg:mx-auto p-4 lg:px-6 grid grid-cols-1 lg:grid-cols-2 gap-8 pb-12 {{ ! first ?= 'mt-12 lg:mt-32' }}&quot;&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">section </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-6xl mx-auto sm:mx-12 lg:mx-auto p-4 lg:px-6 grid grid-cols-1 lg:grid-cols-2 gap-8 pb-12 {{ ! first ?= &#39;mt-12 lg:mt-32&#39; }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-930feb06 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p class="has-medium-font-size wp-block-paragraph">Small Screens (button is fixed):</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p class="has-medium-font-size wp-block-paragraph">Middle Screens:</p>
</div>
</div>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="393" height="849" data-id="1395" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-sm-screen-1.png" alt="" class="wp-image-1395" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-sm-screen-1.png 393w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-sm-screen-1-139x300.png 139w" sizes="auto, (max-width: 393px) 100vw, 393px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="607" height="871" data-id="1396" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mid-screen1-4.png" alt="" class="wp-image-1396" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mid-screen1-4.png 607w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mid-screen1-4-209x300.png 209w" sizes="auto, (max-width: 607px) 100vw, 607px" /></figure>
</figure>



<h4 class="wp-block-heading" style="font-size:clamp(0.957rem, 0.957rem + ((1vw - 0.2rem) * 0.657), 1.45rem);">News Cards</h4>



<p class="wp-block-paragraph">For the news cards it was a very similar issue as the panels, that being the fact of the amount of cards per column and the space on the x-axis.<br>In this case the columns differ in the scaling, meaning that it switches from 1 per column for small screens, 2 per column for medium-large screens (tablets, big ones) and 3 for extra large screens (so desktops for example). <br>The spacing on the sides is the exact same as the panels or even the title, i did this so it has an even spacing so it looks nice and not misarranged.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;div class=&quot;grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-x-8 gap-y-16 mx-auto sm:mx-12 lg:mx-auto&quot;&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-x-8 gap-y-16 mx-auto sm:mx-12 lg:mx-auto</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-930feb06 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p class="has-medium-font-size wp-block-paragraph">Small &amp; Middle Screens:</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p class="has-medium-font-size wp-block-paragraph">Middle-Large Screens (big tablets):</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p class="has-medium-font-size wp-block-paragraph">Large Screens:</p>
</div>
</div>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="592" height="700" data-id="1399" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mid-screen3.png" alt="" class="wp-image-1399" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mid-screen3.png 592w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-mid-screen3-254x300.png 254w" sizes="auto, (max-width: 592px) 100vw, 592px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="632" height="581" data-id="1400" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-lg-screen.png" alt="" class="wp-image-1400" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-lg-screen.png 632w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-lg-screen-300x276.png 300w" sizes="auto, (max-width: 632px) 100vw, 632px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="741" height="471" data-id="1401" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-big-screen.png" alt="" class="wp-image-1401" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-big-screen.png 741w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-big-screen-300x191.png 300w" sizes="auto, (max-width: 741px) 100vw, 741px" /></figure>
</figure>



<p class="wp-block-paragraph">Now another thing i did is on the single news post view is make the picture have rounded corners. The other images are rounded as well so i opted to chance them to be rounded to make it look more uniform which is generally nicer on the eyes. </p>



<p class="wp-block-paragraph">Output:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="773" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-news-1024x773.png" alt="" class="wp-image-1420" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-news-1024x773.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-news-300x226.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-news-768x579.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-news.png 1132w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading has-large-font-size">Features</h2>



<p class="wp-block-paragraph">This was an extension task for my existing Statamic project. The goal is to recreate this &#8220;Features&#8221; part which exists on the hosttech page with Statamic. A added feature to these &#8220;Features&#8221; was that you should be able to select how many columns they should have: 1, 2 or 3.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="632" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/features-1024x632.png" alt="" class="wp-image-1425" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/features-1024x632.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/features-300x185.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/features-768x474.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/features-1536x948.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/features-2048x1263.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now for me the first step was some research. Since i know i would want this to be a part which can be taken and &#8220;injected&#8221; anywhere desired. Now while i knew that in code it would be a partial (for me at least since) because it&#8217;s similar to the panels. The only problem was that i didn&#8217;t know which Statamic element would fit best for this. Now after said research was concluded the i reached the verdict that a &#8220;Global Set&#8221; would fit nicely.<br>For reference to what a global set is: <br><br>A Global Set in Statamic is a centralized container for site-wide content like contact details, branding, or footer text.<br>You define fields and values once in the control panel, then access them anywhere in your templates, ensuring consistency and easier updates.<br>This helps keep your content organized and avoids repeating the same data across multiple pages. </p>



<p class="wp-block-paragraph">Now that i know how im going to create the features i need to actually do it. So for that i created a Global Set called &#8220;Features&#8221; and then a blueprint for it. Then i created a second tab called Layout with a selector field called &#8220;columns_amount&#8221; with the 3 values: 1 Column, 2 Columns and 3 Columns, so you can easily select how many you want.  </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="205" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-columns-1024x205.png" alt="" class="wp-image-1428" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-columns-1024x205.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-columns-300x60.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-columns-768x154.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-columns-1536x307.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-columns.png 1690w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">After that i went back to the main tab and created a replicator field called &#8220;Feature&#8221;. The reason i choose a replicator field is because for like nested elements like this, where you have different parts (texts &amp; image) in a box and i also used the same one for the panels. Now For the replicator field i added the three elements a Feature has: an image (an asset), a title (a text field) and a description (also a text field).</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="406" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-feature-1024x406.png" alt="" class="wp-image-1427" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-feature-1024x406.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-feature-300x119.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-feature-768x305.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-feature-1536x609.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-feature.png 1676w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now with the blueprint completed i could now create the actual &#8220;Features&#8221; that will be displayed.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="996" height="658" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-feature-add.png" alt="" class="wp-image-1429" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-feature-add.png 996w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-feature-add-300x198.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-feature-add-768x507.png 768w" sizes="auto, (max-width: 996px) 100vw, 996px" /></figure>



<p class="wp-block-paragraph">Now with everything done in the Statamic control panel its time to program it so we can actually display it.<br>For that created a new file called &#8220;features.antlers.html&#8221; inside partials folder. <br>Then inside there i added all the necessary html &amp; css code so it will be displayed. The details aren&#8217;t important at this time since I just want to be able to see if it actually works and how it looks. The fine tuning comes a bit later.</p>



<p class="wp-block-paragraph">Now after that we need to add this code to our desired location where we wish to display the Features (once again exactly the same as with the panels just a different name of course):</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="{{ partial:features }}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">features </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="wp-block-paragraph">Now if everything was named correctly and all it should display the features on the main page (since i added this code there). Now for me this didn&#8217;t immediately work and after a bit of trial and error i decided to ask Manuel for assistance since he&#8217;s familiar with Statamic. Then after some trial &amp; error with him we were able to make it work. </p>



<p class="wp-block-paragraph">Now that i can actually see what im doing i can dedicate myself to the details and get the fine tuning done. Since im recreating something its generally just a bit of guessing and trial &amp; error to figure out the distances, sizes and colors for these but after a bit i got it done.<br>Now i had to make sure that it was all compatible with different screen sizes. While it mostly was since i made sure from the beginning that it would be some details i had to add. For example some spacing on the x-axis so its not sitting at the edge of the screen. <br>During that i also constantly checked with the different screens &amp; columns amounts to see if it looked nice and after a bit i was happy and finished.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="360" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-show-1024x360.png" alt="" class="wp-image-1430" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-show-1024x360.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-show-300x106.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-show-768x270.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-show.png 1387w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now after review of what i did with the features i got a few extensions / adjustments i should / need to make. </p>



<p class="wp-block-paragraph">The first one was to adjust the feature description field from a normal text field to a text-area field. That was since the descriptions tend to be on the longer side, they won&#8217;t usually fit on a &#8220;1-Liner&#8221; so the text area makes it easier &amp; nicer to grasp the overview of the description. The change was really simple in Statamic just delete the old text field and add the text area field with the same name &amp; slug.</p>



<p class="wp-block-paragraph">The second part was to change the way i handled the columns amount selecting.  Before i had the if statements directly in the class but now i changed it so each column amount (1, 2 &amp; 3) has its own div. Like so:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="// Before
&lt;div class=&quot;mx-auto grid max-w-5xl grid-cols-1 gap-y-10 md:gap-x-16 justify-items-center {{ if columns_amount == '2' }} md:grid-cols-2 {{ /if }} {{ if columns_amount == '3' }} md:grid-cols-2 lg:grid-cols-3 {{ /if }}&quot;&gt;

// After
{{ if columns_amount == '1' }}
    &lt;div class=&quot;mx-auto grid max-w-5xl grid-cols-1 gap-y-10 md:gap-x-16 justify-items-center&quot;&gt;
{{ elseif columns_amount == '2' }}
    &lt;div class=&quot;mx-auto grid max-w-5xl grid-cols-1 md:grid-cols-2 gap-y-10 md:gap-x-16 justify-items-center&quot;&gt;
{{ elseif columns_amount == '3' }}
    &lt;div class=&quot;mx-auto grid max-w-5xl grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-y-10 md:gap-x-16 justify-items-center&quot;&gt;
{{ /if }}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #616E88">// Before</span></span>
<span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mx-auto grid max-w-5xl grid-cols-1 gap-y-10 md:gap-x-16 justify-items-center {{ if columns_amount == &#39;2&#39; }} md:grid-cols-2 {{ /if }} {{ if columns_amount == &#39;3&#39; }} md:grid-cols-2 lg:grid-cols-3 {{ /if }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #616E88">// After</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> columns_amount </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">1</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mx-auto grid max-w-5xl grid-cols-1 gap-y-10 md:gap-x-16 justify-items-center</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">elseif</span><span style="color: #D8DEE9FF"> columns_amount </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">2</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mx-auto grid max-w-5xl grid-cols-1 md:grid-cols-2 gap-y-10 md:gap-x-16 justify-items-center</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">elseif</span><span style="color: #D8DEE9FF"> columns_amount </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">3</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mx-auto grid max-w-5xl grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-y-10 md:gap-x-16 justify-items-center</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="wp-block-paragraph">Now while yes it is more lines of code its more practical. More specifically it enhances the readability of the code, meaning that it&#8217;s easier to see and grasp what this code does. So while you could argue that since it&#8217;s more lines and also some duplicated its worse but in this instance i&#8217;d wager that the readability of the code is worth more (and for this task it was required).</p>



<p class="wp-block-paragraph">Then the last part was to make it so you can select dark / light mode for the Features so if you have a dark background its still nicely visible. For that in the Layout tab in Statamic i added a Radio field below the column amount selection where you can choose either dark or light mode. I set the dark mode as a default value since my page has a dark background.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="493" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-modes-1024x493.png" alt="" class="wp-image-1434" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-modes-1024x493.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-modes-300x144.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-modes-768x369.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-modes.png 1164w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Then in the code i created a variable &#8220;isDarkmode&#8221; and checked the value given from the &#8220;Feature Background&#8221; radio field if it&#8217;s value is dark. Like so:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="{{ isDarkmode = (feature_background == 'dark') }}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> isDarkmode </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">feature_background </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">dark</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="wp-block-paragraph">After that i went to the affected parts of the code, which were the title and description. There i added a check to see if the variable &#8220;isDarkmode&#8221; is true and if so to make the text bright and if not then make the text dark. The same with the description. Like so:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;h3 class=&quot;mb-3 text-xl font-bold {{ isDarkmode ? 'text-white' : 'text-black' }}&quot;&gt;{{ feature_title }}&lt;/h3&gt;
&lt;p class=&quot;text-md leading-relaxed {{ isDarkmode ? 'text-gray-800' : 'text-gray' }}&quot;&gt;{{ feature_description }}&lt;/p&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h3 </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">mb-3 text-xl font-bold {{ isDarkmode ? &#39;text-white&#39; : &#39;text-black&#39; }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> feature_title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h3</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-md leading-relaxed {{ isDarkmode ? &#39;text-gray-800&#39; : &#39;text-gray&#39; }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> feature_description </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">I opted for a variable solution because its simple and you can just reuse it where ever you wish really. Though in this case this only works inside the &#8220;Features&#8221; global set since the value is set there and is therefor confined in there. Now yes you could make a call to the inside of the &#8220;Features&#8221; global set to access the value given there it&#8217;s highly discouraged to make something like that. If you wish to have a global dark / light mode then you should make a new global set for example. </p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-930feb06 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p class="has-medium-font-size wp-block-paragraph">Dark Mode / Background:</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<p class="has-medium-font-size wp-block-paragraph">Light Mode / Background:</p>
</div>
</div>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="700" height="525" data-id="1436" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-dark.png" alt="" class="wp-image-1436" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-dark.png 700w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-dark-300x225.png 300w" sizes="auto, (max-width: 700px) 100vw, 700px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="654" height="379" data-id="1437" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-light-1.png" alt="" class="wp-image-1437" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-light-1.png 654w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-features-light-1-300x174.png 300w" sizes="auto, (max-width: 654px) 100vw, 654px" /></figure>
</figure>



<h3 class="wp-block-heading has-large-font-size">Support Card</h3>



<p class="wp-block-paragraph">A new addition is a &#8220;support card&#8221;, it&#8217;s a card with some base information &amp; a picture of the support team. I got a reference image which i should recreate.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="576" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-1024x576.png" alt="" class="wp-image-1450" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-1024x576.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-300x169.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-768x432.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-1536x864.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-2048x1152.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph"><br>The first step was to decide what it should be, after which i decided that a global would fit because it has quite similar use cases to the features which is a global. So i created a new global set and named it &#8220;Support Card&#8221; and then i added the fields which i required: some text fields, an image, and a button. Like so:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="663" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-support-card-bp-1024x663.png" alt="" class="wp-image-1444" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-support-card-bp-1024x663.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-support-card-bp-300x194.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-support-card-bp-768x498.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-support-card-bp.png 1173w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now that the blueprint was done i added some filler for the content of the support card, so it would actually have something to display.</p>



<p class="wp-block-paragraph">Then i moved over to the code editor, for that i created a new file in the partials folder called &#8220;support_card.antlers.html&#8221; and directly added it to the &#8220;home.antlers.html&#8221; file so it will be displayed once i make any changes.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="{{ partial:support_card }}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">support_card </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="wp-block-paragraph">After that i coded the support card itself on how it should be displayed. This takes a short moment but over time the whole thing with tailwind css and the mobile first stuff comes easier which is nice. Sometimes i had to look up how exactly a tailwind class is named or how to do something. For example i learned that you can make / use negative margins which i actually used here to make sure the image is at the very bottom-right. This is the final result:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="598" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-support-card-1024x598.png" alt="" class="wp-image-1445" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-support-card-1024x598.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-support-card-300x175.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-support-card-768x449.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-support-card-1536x898.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-support-card.png 1624w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading has-large-font-size">Contact Card (Support)</h3>



<p class="wp-block-paragraph">A second new addition is similar to what i did just before with the &#8220;Support Card&#8221; since the base is the same but this has now a form which you can contact the support with. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="635" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-1-1024x635.png" alt="" class="wp-image-1451" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-1-1024x635.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-1-300x186.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-1-768x476.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-1.png 1315w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now the first thing i did same as with the Support card is create a new global for the contact card. For that i took the different parts, the title, description, the image, the contact button (which will submit the form) then the contact number and lastly the contact times. I went for a text field for the contact times because on the reference image i got the text is multiple lines. So when (in Statamic) you add the text and you format it how you want it then I or well one can make it so it displayed exactly like that with the line amount. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="520" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-card-bp-1024x520.png" alt="" class="wp-image-1452" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-card-bp-1024x520.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-card-bp-300x152.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-card-bp-768x390.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-card-bp.png 1198w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now one might notice that the fields required for a form are missing, that is because Statamic has &#8220;Forms&#8221; feature which you can control and even generate those. So the next step was to create a Form for this contact card. Now here i added the desired form fields. The company as an optional text field, the first name as a required text field same as the last name, the email as an email text field and finally the concern as a required text field. <br><br>In Statamic you can enter which fields are required and which aren&#8217;t under the validation tab. I opted for these required fields because from the reference image it looks like the company is the only optional one and just as a general understanding it wouldn&#8217;t make sense the have the name (full name), the email or the concern missing. Now while you could perhaps make the first name maybe even instead the last name optional but to my knowledge that isn&#8217;t common practice at least if both fields exist. I would rather then just remove the first / last name field completely.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="480" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-form-bp-1024x480.png" alt="" class="wp-image-1453" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-form-bp-1024x480.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-form-bp-300x141.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-form-bp-768x360.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-form-bp.png 1177w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">The last step is that since it is wished that I receive an email whenever someone submits this form (so you can see and respond in a timely manner) was to edit the form itself.  There is an email section under which you can enter who should receive the email from whom the email should be sent the subject, the attachments, etc. so just all those settings. In my case i entered my email address  and a fitting subject.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="719" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-form-1024x719.png" alt="" class="wp-image-1454" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-form-1024x719.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-form-300x211.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-form-768x540.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-form.png 1516w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now that were done with the Statamic site part we can head to the code editor. I firstly created a new file inside the partials folder called &#8220;contact_card.antlers.html&#8221;  and programmed the necessary code. Something special with the Statamic Forms (which you call with &#8220;{{ form:contact }}&#8221;) is that it has inbuilt features for error &amp; success handling so you can easily provide user feedback based on the result. For that you can just make an if check for errors or success and  then display the errors or any given success message and display them as wished. Here&#8217;s how i did it for example:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="{{ if success }}
    &lt;div class=&quot;rounded-2xl border border-green-200 bg-green-50 px-5 py-4 text-sm text-green-800&quot;&gt;
        Thank you — your message has been sent successfully.
    &lt;/div&gt;
{{ /if }}

{{ if errors }}
    &lt;div class=&quot;rounded-2xl border border-red-200 bg-red-50 px-5 py-4 text-sm text-red-dark&quot;&gt;
        &lt;ul class=&quot;space-y-1&quot;&gt;
            {{ errors }}
            &lt;li&gt;{{ value }}&lt;/li&gt;
            {{ /errors }}
        &lt;/ul&gt;
    &lt;/div&gt;
{{ /if }}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> success </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">rounded-2xl border border-green-200 bg-green-50 px-5 py-4 text-sm text-green-800</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        Thank you — your message has been sent successfully</span><span style="color: #81A1C1">.</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> errors </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">rounded-2xl border border-red-200 bg-red-50 px-5 py-4 text-sm text-red-dark</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">ul </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">space-y-1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> errors </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> value </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">errors </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">ul</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="wp-block-paragraph">Now another thing that i did (which was also something i had to do) is see that i can extract something into its own partial so it can be reused. Meaning that i don&#8217;t have to write duplicate code. Now after looking it over i decided on the button which has been used for both cards (support &amp; contact card). Since they were almost identical. For that i created a new folder inside the partials folder called &#8220;components&#8221; and inside there a new file called &#8220;support_button.antlers.html&#8221;. Then i added the code for the button. Now i needed to add something new because in the support card the button is a link and in the contact card its a form submit button. So for that i added if checks along with parameters you can fill so you can display either depending on which you require. Like so:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="---
as: button
type: button
text: Button
---

{{ button_classes = &quot;inline-flex items-center justify-center rounded-2xl bg-&#91;#e11d48&#93; px-8 py-3.5 text-lg font-semibold text-white transition hover:brightness-90&quot; }}

{{ if as == &quot;link&quot; &amp;&amp; url }}
&lt;a
    href=&quot;{{ url }}&quot;
    class=&quot;{{ button_classes }}&quot;
    {{ if target }}target=&quot;{{ target }}&quot;{{ /if }}
{{ if rel }}rel=&quot;{{ rel }}&quot;{{ /if }}
&gt;
{{ text }}
&lt;/a&gt;
{{ else }}
&lt;button
    type=&quot;{{ type }}&quot;
    class=&quot;{{ button_classes }} cursor-pointer&quot;
    {{ if name }}name=&quot;{{ name }}&quot;{{ /if }}
{{ if value }}value=&quot;{{ value }}&quot;{{ /if }}
&gt;
{{ text }}
&lt;/button&gt;
{{ /if }}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">---</span></span>
<span class="line"><span style="color: #81A1C1">as:</span><span style="color: #D8DEE9FF"> button</span></span>
<span class="line"><span style="color: #D8DEE9FF">type: button</span></span>
<span class="line"><span style="color: #D8DEE9FF">text: Button</span></span>
<span class="line"><span style="color: #81A1C1">---</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> button_classes </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">inline-flex items-center justify-center rounded-2xl bg-&#91;#e11d48&#93; px-8 py-3.5 text-lg font-semibold text-white transition hover:brightness-90</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">as</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">link</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&amp;&amp;</span><span style="color: #D8DEE9FF"> url </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a</span></span>
<span class="line"><span style="color: #D8DEE9FF">    href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ button_classes }}</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> target </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF">target</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ target }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> rel </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF">rel</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ rel }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> text </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">button</span></span>
<span class="line"><span style="color: #D8DEE9FF">    type</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ type }}</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ button_classes }} cursor-pointer</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> name </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF">name</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ name }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> value </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF">value</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ value }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> text </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">button</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="---
as: button
type: button
text: Button
---" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">---</span></span>
<span class="line"><span style="color: #81A1C1">as:</span><span style="color: #D8DEE9FF"> button</span></span>
<span class="line"><span style="color: #D8DEE9FF">type: button</span></span>
<span class="line"><span style="color: #D8DEE9FF">text: Button</span></span>
<span class="line"><span style="color: #81A1C1">---</span></span></code></pre></div>



<p class="wp-block-paragraph">These are said parameters, they function as an API so you can give a value for them and depending on the value it will then display what is &#8220;assigned&#8221; that value. Now all that was left is inject the button component back into our contact card, like so:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;div class=&quot;pt-2&quot;&gt;
    {{ partial:components/support_button
    text={ contact_button_text }
    as=&quot;button&quot;
    type=&quot;submit&quot;
    }}
&lt;/div&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">pt-2</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">support_button</span></span>
<span class="line"><span style="color: #D8DEE9FF">    text</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> contact_button_text </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">as=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">button</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    type</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">submit</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">The second part that i extracted into its own components is the form itself. That is because chances are that one will have more that 1 form field in a website. For that i created new filed in the recently created components folder called &#8220;contact_from.antlers.html&#8221; and added my code for the form fields. After which i also had to add it back to the contact card, like so:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="{{ partial:components/contact_form }}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">components</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">contact_form </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="wp-block-paragraph">Final result:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="719" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-card-1024x719.png" alt="" class="wp-image-1456" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-card-1024x719.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-card-300x211.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-card-768x539.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-card-1536x1079.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-contact-card.png 1690w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading has-large-font-size">Stars (Rating) Component</h3>



<p class="wp-block-paragraph">The next addition is a Stars Rating Component, the goal is to recreate it as given in the following image with the options to choose the stars amount and the amount of reference links which automatically adjust the text if you have a different amount so with 1 reference link: Bei xxx, with 2 Bei xxx und xxx and for each more for the to be separated by a &#8220;,&#8221; besides the last one of course.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="390" height="70" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-2.png" alt="" class="wp-image-1459" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-2.png 390w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/image-2-300x54.png 300w" sizes="auto, (max-width: 390px) 100vw, 390px" /></figure>



<p class="wp-block-paragraph">As always i firstly did what i needed in Statamic. I first thought about making it a global since its also a component as the what i created before with the cards but since the stars review is more so used in conjunction with something i opted for a Fieldset since they are here to be incorporated into other blueprints. So i created a new Fieldset and named it &#8220;Stars&#8221; and then i created a &#8220;select field&#8221; for the stars amount, i was torn between a slider and a selector but the decision fell to the selector because you can&#8217;t make the slider in .5 increments which eliminated it as a valid option. And then a &#8220;Grid&#8221; for the reviewer / reference list in which i added 2 simple text fields, 1 for the name you wish to have displayed and 1 for the link for the reviewer. I choose a grid since it makes it easy to add multiple items of which in this case are the reviewers.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="557" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-bp-1024x557.png" alt="" class="wp-image-1460" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-bp-1024x557.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-bp-300x163.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-bp-768x418.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-bp.png 1171w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">After that i had to incorporate it into another blueprint for which i choose the landing page since i displayed my previous works there as well. <br>So i headed to the blueprint for the landing page and added a new tab, named it stars reviewers and &#8220;imported&#8221; the stars fieldset i created, like so:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="450" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-bp1-1024x450.png" alt="" class="wp-image-1461" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-bp1-1024x450.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-bp1-300x132.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-bp1-768x337.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-bp1-1536x674.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-bp1.png 1770w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now i could head to the landing page itself and create some filler so it will actually display something once i add the code.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="711" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-content-1024x711.png" alt="" class="wp-image-1462" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-content-1024x711.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-content-300x208.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-content-768x533.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-content.png 1222w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now for the select field i had (wanted) to adjust something and that is the options and their values i firstly did the following:<br>&#8211; value: 0 -&gt; star amount: 0<br>&#8211; value: 0.5 -&gt; star amount: 0.5<br>&#8211; value 1 -&gt; star amount: 1<br><br>But then when you actually selected the fields (in the landing page) the order would be messed up since the decimal values would all be bunched up so i adjusted the values to full numbers like so:<br>&#8211; value: 0 -&gt; star amount: 0<br>&#8211; value 1 -&gt; star amount: 0.5<br>&#8211; value 2 -&gt; star amount: 1<br>Because like this the order is nicely arranged, going from 0 to 5 stars and not mixed.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="323" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-selectamount-1024x323.png" alt="" class="wp-image-1463" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-selectamount-1024x323.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-selectamount-300x95.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-selectamount-768x243.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-selectamount-1536x485.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-selectamount-2048x647.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now with everything done in the Statamic part i headed to the code. There i created a new file inside the components folder insides the patials folder named &#8220;start_review.antlers.html&#8221;. I added it inside the components folder since it seemed to small to be a &#8220;full&#8221; partial and since its used in conjunction with something else it seemed a better fit. <br><br>Here there were two main hurdles the first one being the logic behind the stars so they are displayed correctly via the amount selected and the other hurdle is that the reviewers are correctly separated &amp; displayed. </p>



<p class="wp-block-paragraph">For the first hurdle i did some research on the best way on how to go about doing that, googled, asked AI also to see if what i got from other sources is the same as what AI would recommend which it was though AI was able to give a more detailed breakdown of the matter in a shorter span of time. <br><br>In the end i went with mathematical logic to see if the value is odd or even to define whether a full or a half star should be displayed and then the &#8220;basic&#8221; star which are always there inside a loop so it repeats that 5 times (for 5 stars). I tried getting the svg from the hosttech website since thats where the original image for the task came from but it didn&#8217;t seem to want to work so i asked ai to give me a suitable svg for the stars which is the one i used.  </p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="{{ loop from=&quot;1&quot; to=&quot;5&quot; }}
{{ if star_amount.value &gt;= (value * 2) }}
{{# full star #}}
  // code for displaying full star
{{ elseif star_amount.value == ((value * 2) - 1) }}
{{# half star #}}
  // code for displaying half star
{{ else }}
{{# empty star #}}
  // code for displaying empty star
{{ /if }}
{{ /loop }}" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> loop from</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> to</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">5</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> star_amount</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">value </span><span style="color: #81A1C1">&gt;=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">value </span><span style="color: #81A1C1">*</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">2</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #616E88"># full star #}}</span></span>
<span class="line"><span style="color: #ECEFF4">  </span><span style="color: #616E88">// code for displaying full star</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">elseif</span><span style="color: #D8DEE9FF"> star_amount</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">value </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">((</span><span style="color: #D8DEE9FF">value </span><span style="color: #81A1C1">*</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">2</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">1</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #616E88"># half star #}}</span></span>
<span class="line"><span style="color: #ECEFF4">  </span><span style="color: #616E88">// code for displaying half star</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #616E88"># empty star #}}</span></span>
<span class="line"><span style="color: #ECEFF4">  </span><span style="color: #616E88">// code for displaying empty star</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">loop </span><span style="color: #ECEFF4">}}</span></span></code></pre></div>



<p class="wp-block-paragraph">The second hurdle was a bit simpler since &#8220;all&#8221; that was required was an if check. Well it was a bit more complicated than that but that&#8217;s the gist of it. <br>So i added a check that if it isn&#8217;t the first element and if its the last element that it should display an &#8220;und&#8221; otherwise an &#8220;,&#8221; like so:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" data-code="&lt;p class=&quot;text-sm text-gray-900 font-semibold&quot;&gt;Bei {{ reviewer_list }}{{ if !first }}{{ if last }} und {{ else }}, {{ /if }}{{ /if }}&lt;a href=&quot;{{ reviewer_link }}&quot; class=&quot;underline hover:no-underline&quot; target=&quot;_blank&quot;&gt;{{ reviewer_name }}&lt;/a&gt;{{ /reviewer_list }}&lt;/p&gt;" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-sm text-gray-900 font-semibold</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">Bei </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> reviewer_list </span><span style="color: #ECEFF4">}}{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">!</span><span style="color: #D8DEE9FF">first </span><span style="color: #ECEFF4">}}{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> last </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF"> und </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}},</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ reviewer_link }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">underline hover:no-underline</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> target</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">_blank</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> reviewer_name </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">reviewer_list </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">Final Result:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="620" height="302" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-display.png" alt="" class="wp-image-1464" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-display.png 620w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-stars-display-300x146.png 300w" sizes="auto, (max-width: 620px) 100vw, 620px" /></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Statamic</title>
		<link>https://flurin-lernjournal.hosttech.ch/statamic/</link>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Thu, 05 Feb 2026 10:18:57 +0000</pubDate>
				<category><![CDATA[Befehle]]></category>
		<category><![CDATA[Erklärungen]]></category>
		<category><![CDATA[hosttech]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Lernjournal]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://flurin-lernjournal.hosttech.ch/?p=1332</guid>

					<description><![CDATA[Generally the way you add the Statamic elements or content in the code is somewhat similar as you would do in Blade. So very simply put, you just add whatever you wish to include that&#8217;s from Statamic between 2 curly braces like so &#8220;{{ element }}&#8221;.An example is shown for each &#8220;Category&#8221; below. Collections Collections [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="has-medium-font-size wp-block-paragraph">Generally the way you add the Statamic elements or content in the code is somewhat similar as you would do in Blade. So very simply put, you just add whatever you wish to include that&#8217;s from Statamic between 2 curly braces like so &#8220;{{ element }}&#8221;.<br>An example is shown for each &#8220;Category&#8221; below.</p>



<h3 class="wp-block-heading has-large-font-size">Collections</h3>



<p class="wp-block-paragraph"><strong>Collections</strong> are groups of content entries similar to “post types” in other CMS platforms.<br>They are typically used for:</p>



<ul class="wp-block-list">
<li>Blog posts</li>



<li>News articles</li>



<li>Projects</li>



<li>Events</li>



<li>Case studies</li>
</ul>



<p class="wp-block-paragraph">Each collection:</p>



<ul class="wp-block-list">
<li>Has its own URL structure</li>



<li>Can be dated (like blog posts)</li>



<li>Uses a blueprint to define its fields</li>



<li>Stores entries in flat files (Markdown + YAML) by default</li>
</ul>



<p class="wp-block-paragraph">Think of a collection as a structured container for repeatable content.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="455" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-collection-1024x455.png" alt="" class="wp-image-1337" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-collection-1024x455.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-collection-300x133.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-collection-768x341.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-collection-1536x683.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-collection-2048x911.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Here&#8217;s how i did it with my homepage. So as mentioned you take the double curly braces &#8220;{{ }}&#8221; and then add whatever you wish which is in this case &#8220;template_content&#8221; and the partials, which are the navigation (at the top of the page) and the footer (at the bottom). </p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;body class="bg-gray-100 font-sans leading-normal text-gray-500 relative min-h-screen overscroll-none" id="top">
    &lt;header class="max-w-7xl mx-auto">
        {{ partial:nav }}
    &lt;/header>
    {{ template_content }}
    {{ yield:content }}
    {{ partial:footer }}
    &lt;div class="absolute z-40 w-full inset-0 opacity-75 pointer-events-none" style="background: url('/img/film-overlay.png') top     center; background-size: 1400px">&lt;/div>
    &lt;script src="{{ mix src="/js/site.js" }}">&lt;/script>
&lt;/body>
&lt;/html></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">body </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">bg-gray-100 font-sans leading-normal text-gray-500 relative min-h-screen overscroll-none</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> id</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">top</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">header </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">max-w-7xl mx-auto</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">nav </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">header</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> template_content </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">yield:</span><span style="color: #D8DEE9FF">content </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> partial</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">footer </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute z-40 w-full inset-0 opacity-75 pointer-events-none</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> style</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">background: url(&#39;/img/film-overlay.png&#39;) top     center; background-size: 1400px</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">script src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ mix src=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">js</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">site</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">js</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">script</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">body</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">html</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<h3 class="wp-block-heading has-large-font-size">Navigation</h3>



<p class="wp-block-paragraph"><strong>Navigation</strong> allows you to manage menus and link structures across your site. You can create multiple menus (like main navigation or footer navigation), reorder items with drag-and-drop, and nest links for dropdown menus. It separates content management from how links are displayed.<br>You can:</p>



<ul class="wp-block-list">
<li>Build structured menus (main nav, footer nav, etc.)</li>



<li>Drag and drop pages into order</li>



<li>Add external links</li>



<li>Nest items for dropdowns</li>
</ul>



<p class="wp-block-paragraph">Navigation is separate from collections — it’s purely for organizing how links appear in your frontend.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="409" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-nav-1024x409.png" alt="" class="wp-image-1338" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-nav-1024x409.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-nav-300x120.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-nav-768x307.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-nav-1536x614.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-nav-2048x819.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">I used the &#8220;Navigation&#8221; part / feature in my footer here&#8217;s how. So as mentioned you take the double curly braces &#8220;{{ }}&#8221; and then add whatever you wish which is in this case &#8220;nav:footer&#8221;. The nav means that its a &#8220;Navigation&#8221; part / feature and the footer part is the name of the wanted navigation.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;div class="lg:pl-12">
                &lt;nav class="text-lg antialiased -ml-1">
                    &lt;ul>
                        {{ nav:footer }}
                        &lt;li>&lt;a class="p-1 inline-block transition hover:text-white" {{ if external }} target="_blank" rel="noopener"     {{ /if }} href="{{ url }}">{{ title }}&lt;/a>&lt;/li>
                        {{ /nav:footer }}
                    &lt;/ul>
                &lt;/nav>
            &lt;/div></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">lg:pl-12</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">nav </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-lg antialiased -ml-1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">ul</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> nav</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">footer </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;&lt;</span><span style="color: #D8DEE9FF">a </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">p-1 inline-block transition hover:text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> external </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF"> target</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">_blank</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> rel</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">noopener</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF">     </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span><span style="color: #D8DEE9FF"> href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">li</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                        </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">nav</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">footer </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">                    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">ul</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">nav</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<h3 class="wp-block-heading has-large-font-size">Taxonomies</h3>



<p class="wp-block-paragraph"><strong>Taxonomies</strong> are systems for organizing and classifying content. They allow you to group entries using shared terms like categories, tags, or topics. This makes it easy to filter content and generate archive-style pages dynamically.<br>Common examples:</p>



<ul class="wp-block-list">
<li>Categories</li>



<li>Tags</li>



<li>Topics</li>



<li>Authors</li>
</ul>



<p class="wp-block-paragraph">They allow you to:</p>



<ul class="wp-block-list">
<li>Group entries across collections</li>



<li>Filter content dynamically</li>



<li>Create archive pages (e.g., all posts in “Design”)</li>
</ul>



<p class="wp-block-paragraph">Taxonomies consist of <strong>terms</strong>, and entries can be assigned one or more terms.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="377" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy-1024x377.png" alt="" class="wp-image-1339" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy-1024x377.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy-300x110.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy-768x282.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy-1536x565.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy-2048x753.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Here&#8217;s a news article where you can add the Taxonomies (Tags):</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="689" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy1-1024x689.png" alt="" class="wp-image-1346" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy1-1024x689.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy1-300x202.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy1-768x517.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy1-1536x1033.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-taxonomy1.png 1564w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">I didn&#8217;t use Taxonomies to extensively but i did use them for some extra visuals for the news page for the entries there. So as mentioned you take the double curly braces &#8220;{{ }}&#8221; and then add whatever you wish which is in this case &#8220;tags&#8221;. The tag is the name of the Taxonomy used in my case and the &#8220;limit=1&#8221; is just here so only one is shown even if more are assigned but in my instance that isn&#8217;t the case. </p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;div class="flex items-end justify-between">
            &lt;div>
                &lt;p>{{ date }}&lt;/p>
                &lt;p class="text-sm">By &lt;a href="" class="text-gray-700 hover:text-white">{{ author:name }}&lt;/a>&lt;/p>
            &lt;/div>
            {{ if ! hide_tag }}
            {{ tags limit="1" }}
            &lt;a href="{{ url }}" class="px-3 py-1 text-gray-100 font-bold bg-yellow transition hover:bg-orange rounded-full text-sm">{{ title }}&lt;/a>
            {{ /tags }}
            {{ /if }}
        &lt;/div></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">flex items-end justify-between</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> date </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">                </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">p </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-sm</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">By </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">text-gray-700 hover:text-white</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> author</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF">name </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">p</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">!</span><span style="color: #D8DEE9FF"> hide_tag </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> tags limit</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">1</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">px-3 py-1 text-gray-100 font-bold bg-yellow transition hover:bg-orange rounded-full text-sm</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> title </span><span style="color: #ECEFF4">}}</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">tags </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #ECEFF4">{{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">/if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">}}</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>



<h3 class="wp-block-heading has-large-font-size">Blueprints</h3>



<p class="wp-block-paragraph"><strong>Blueprints</strong> define the structure and fields available for content editing. They control what input fields appear in the control panel and determine how content is structured and validated. Blueprints make Statamic flexible and allow developers to tailor the editing experience precisely to project needs.<br>They:</p>



<ul class="wp-block-list">
<li>Control what fields appear in the CMS (title, image, text, etc.)</li>



<li>Define validation rules</li>



<li>Can be reused across collections and taxonomies</li>



<li>Are stored as YAML files</li>
</ul>



<p class="wp-block-paragraph">If collections are containers for content, blueprints are the “form builder” that defines what content fields exist inside them.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="481" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-bp1-1024x481.png" alt="" class="wp-image-1340" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-bp1-1024x481.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-bp1-300x141.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-bp1-768x361.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-bp1-1536x721.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-bp1-2048x961.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Folder Structure inside the Project:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="468" height="420" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-bp.png" alt="" class="wp-image-1341" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-bp.png 468w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-bp-300x269.png 300w" sizes="auto, (max-width: 468px) 100vw, 468px" /></figure>



<h3 class="wp-block-heading has-large-font-size">Assets</h3>



<p class="wp-block-paragraph">Assets in Statamic are the files used throughout your website, such as images, PDFs, videos, and downloadable documents. They are managed inside asset containers, which map to specific folders in your project and can be stored locally or in cloud storage like S3.</p>



<p class="wp-block-paragraph">From the control panel, you can upload, browse, organize, and edit metadata (alt text, titles, etc.) for each file. Assets can then be selected inside entries via blueprint fields, making them reusable and centrally managed across your site.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="440" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-assets-1024x440.png" alt="" class="wp-image-1342" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-assets-1024x440.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-assets-300x129.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-assets-768x330.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-assets-1536x660.png 1536w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2026/02/statamic-assets-2048x881.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">I only used the assets for images, no PDFs or videos or so. As mentioned you take the double curly braces &#8220;{{ }}&#8221; inside the &#8220;src=&#8221; and add what you wish to display.  Glide is a package which is used to optimize images to make the file size smaller and gives you options to modify the image. You could make the image black &amp; white or tilt it or focus it to a specific point which you can then define in Statamic.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;a href="{{ url }}" class="relative overflow-hidden rounded-t-xl">
        &lt;img class="object-cover transition duration-&#91;400ms&#93; ease-in-out scale-110 group-hover:scale-100 w-full h-60" src="{{ glide :src="featured_image" width="600" height="400" fit="crop_focal" }}" alt="">
        &lt;div class="absolute opacity-0 transition duration-&#91;400ms&#93; ease-in-out group-hover:opacity-75 z-20 inset-0 mix-blend-overlay object-cover w-full h-60 bg-gradient-to-br from-orange-dark to-aqua">&lt;/div>
    &lt;/a></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">a href</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ url }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">relative overflow-hidden rounded-t-xl</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">img </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">object-cover transition duration-&#91;400ms&#93; ease-in-out scale-110 group-hover:scale-100 w-full h-60</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> src</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">{{ glide :src=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF">featured_image</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> width=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #B48EAD">600</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> height=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #B48EAD">400</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> fit=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF">crop_focal</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C"> }}</span><span style="color: #ECEFF4">&quot;</span><span style="color: #D8DEE9FF"> alt</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;&quot;</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">div </span><span style="color: #81A1C1">class=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">absolute opacity-0 transition duration-&#91;400ms&#93; ease-in-out group-hover:opacity-75 z-20 inset-0 mix-blend-overlay object-cover w-full h-60 bg-gradient-to-br from-orange-dark to-aqua</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;/</span><span style="color: #D8DEE9FF">div</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">a</span><span style="color: #81A1C1">&gt;</span></span></code></pre></div>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Insights after Tasks</title>
		<link>https://flurin-lernjournal.hosttech.ch/insights-after-tasks/</link>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Mon, 22 Sep 2025 13:25:14 +0000</pubDate>
				<category><![CDATA[Befehle]]></category>
		<category><![CDATA[Erklärungen]]></category>
		<category><![CDATA[hosttech]]></category>
		<category><![CDATA[Lernjournal]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://flurin-lernjournal.hosttech.ch/?p=1234</guid>

					<description><![CDATA[I&#8217;ve now completed my first four tasks, during which I had the chance to look and work with the wonderland code. I saw a good amount of things that were or at least looked familiar while some things were completely new. Though even there with just looking at and reading the code I was able [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="has-small-font-size wp-block-paragraph">I&#8217;ve now completed my first four tasks, during which I had the chance to look and work with the wonderland code. I saw a good amount of things that were or at least looked familiar while some things were completely new. Though even there with just looking at and reading the code I was able to build a general idea of what the code does or might do, which is well how it should be.</p>



<p class="has-small-font-size wp-block-paragraph">The first thing you need to do, is figure out weather the code is in the wonderland or myhosttech codebase because that&#8217;s dependent on where you create your issue and merge request.</p>



<p class="has-small-font-size wp-block-paragraph">So far it was only easy tasks, just deleting code still leftover or a unneeded part, for example a Handler and it&#8217;s dependencies. Now the latest task was a tad bit more complex, since it wasn&#8217;t quite to just remove code, well mostly at least. Since I removed part code that was part of switch cases which only had two cases, one I now deleted which makes the switch case unnecessary. So I &#8220;had&#8221; to or well for the sake of keeping the code as small and non redundant as possible rewrite the code. In this case it went something like this:</p>



<p class="has-small-font-size wp-block-paragraph">original code:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>public function getNotHosttechData($key) // code censored on purpose
{
    $transporterData = &#91; 
        'phone' => '000 000 00 00', 
        'website' => 'www.example.com'
    &#93;;
    $pcvertriebData = &#91;
        'phone' => '000 000 00 00',
        'website' => 'www.example.com'
    &#93;;
    switch ($this->invoice->layout) {
        case Invoices::LAYOUT_123TRANSPORTER:
            return $transporterData&#91;$key&#93;;
            break;
        case Invoices::LAYOUT_HARDWARE:
            return $pcvertriebData&#91;$key&#93;;
            break;
    }
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">getNotHosttechData</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">key</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// code censored on purpose</span></span>
<span class="line"><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">transporterData</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #D8DEE9FF"> </span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">phone</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">000 000 00 00</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">website</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">www.example.com</span><span style="color: #ECEFF4">&#39;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">pcvertriebData</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#91;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">phone</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">000 000 00 00</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">website</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">www.example.com</span><span style="color: #ECEFF4">&#39;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">switch</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">invoice</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">layout</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">case</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">Invoices</span><span style="color: #81A1C1">::</span><span style="color: #D8DEE9FF">LAYOUT_123TRANSPORTER</span><span style="color: #81A1C1">:</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">transporterData</span><span style="color: #ECEFF4">&#91;</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">key</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">break;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">case</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">Invoices</span><span style="color: #81A1C1">::</span><span style="color: #D8DEE9FF">LAYOUT_HARDWARE</span><span style="color: #81A1C1">:</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">pcvertriebData</span><span style="color: #ECEFF4">&#91;</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">key</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">break;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Then my first fix / rewrite:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>public function getNotHosttechData($key) // code censored on purpose
{
    $transporterData = &#91;
        'phone' => '000 000 00 00',
        'website' => 'www.example.com'
    &#93;;
  
    if ($this->invoice->layout === Invoices::LAYOUT_123TRANSPORTER) {
      return $transporterData&#91;$key&#93;;
    }
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">getNotHosttechData</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">key</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// code censored on purpose</span></span>
<span class="line"><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">transporterData</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#91;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">phone</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">000 000 00 00</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">website</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">www.example.com</span><span style="color: #ECEFF4">&#39;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">invoice</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">layout</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">===</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">Invoices</span><span style="color: #81A1C1">::</span><span style="color: #D8DEE9FF">LAYOUT_123TRANSPORTER</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">      </span><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">transporterData</span><span style="color: #ECEFF4">&#91;</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">key</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">But as it turns out even the if statement was not needed so in the end in just looked like this:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>public function getNotHosttechData($key) // code censored on purpose, makes function and gives $key variable
{
    $transporterData = &#91; // associative array
        'phone' => '000 000 00 00', // key with assigned value
        'website' => 'www.example.com' // key with assigned value
    &#93;;
  
    return $transporterData&#91;$key&#93;; // returns either value depending on which key is called
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">getNotHosttechData</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">key</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// code censored on purpose, makes function and gives $key variable</span></span>
<span class="line"><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">transporterData</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#91;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// associative array</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">phone</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">000 000 00 00</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// key with assigned value</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">website</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">www.example.com</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// key with assigned value</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">transporterData</span><span style="color: #ECEFF4">&#91;</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">key</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// returns either value depending on which key is called</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">So as you can see I was able to shorten the code by quite a bit. Now while yes one could&#8217;ve done this:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>public function getNotHosttechData($key) // code censored on purpose
{
    $transporterData = &#91;
        'phone' => '000 000 00 00',
        'website' => 'www.example.com'
    &#93;;
    
    switch ($this->invoice->layout) {
        case Invoices::LAYOUT_123TRANSPORTER:
            return $transporterData&#91;$key&#93;;
            break;
    }
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">getNotHosttechData</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">key</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// code censored on purpose</span></span>
<span class="line"><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">transporterData</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#91;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">phone</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">000 000 00 00</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">,</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">website</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">www.example.com</span><span style="color: #ECEFF4">&#39;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">switch</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">invoice</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">layout</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">case</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">Invoices</span><span style="color: #81A1C1">::</span><span style="color: #D8DEE9FF">LAYOUT_123TRANSPORTER</span><span style="color: #81A1C1">:</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">transporterData</span><span style="color: #ECEFF4">&#91;</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">key</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">break;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Just quickly look at both of them and one can see that the first option looks much better. A lot less unnecessary code laying around.</p>



<p class="has-small-font-size wp-block-paragraph">Now since I made adjustments to the code I need to test it to see if it still works. In this case I firstly had to find out how to trigger this part of the code, in this case it was part of a Pdf generation so I needed to trigger this Pdf getting generated. Now for that I created a new &#8220;Einzelrechnung&#8221; then set a position and then created the invoice with the 123 Transporter-Layout since that&#8217;s what the requirement was to trigger that specific Pdf creation. After that I downloaded the Pdf and checked if it&#8217;s correct. </p>



<h3 class="wp-block-heading has-medium-font-size">Understand the code</h3>



<p class="has-small-font-size wp-block-paragraph">An important thing to note is that before you delete or especially before you add code that you understand what the code does. Since then you can check if what you&#8217;re deleting is actually correct or if there&#8217;s maybe another part under a different name or so which also needs / should be deleted. Or if then you add code, how you need to implement the code. Not only the code you want to chance also around the code, what&#8217;s above and below and to the sides (other files that are bound via functions, constants, etc.). </p>



<h3 class="wp-block-heading has-medium-font-size">Testing</h3>



<p class="has-small-font-size wp-block-paragraph">Also after you make a chance in the code make sure to test it. In the Laravel part(myhosttech) you write a test and in the Zend part(wonderland) you test it hands on with the test website usually. So for a test you go to &#8220;myhosttech.test&#8221; and figure out where this gets done and then make it happen. </p>



<p class="wp-block-paragraph">Here some useful tools to help locate code instances or parts:</p>



<ul class="wp-block-list">
<li class="has-small-font-size">&#8220;Ctrl + F&#8221; &#8211; Search the current file for whichever you enter.</li>



<li class="has-small-font-size">&#8220;Ctrl  + Shift + F&#8221; &#8211; Same as &#8220;Ctrl + F&#8221; but inside the whole project not just the current file.</li>



<li class="has-small-font-size">&#8220;Double Shift&#8221; (press Shift twice in quick succession) &#8211; Search filenames with what you enter.</li>



<li class="has-small-font-size">&#8220;Ctrl + Click&#8221; &#8211;  Click on a function, class, etc. you will see each instance where that function / class / etc. is called.<br>Just try it if it work with what you tried you will notice (for example, mouse will turn from cursor to pointer).</li>
</ul>



<h3 class="wp-block-heading has-medium-font-size">Review Issues mit Manu</h3>



<p class="has-small-font-size wp-block-paragraph"><strong>MR / Issue Review</strong><br>Remove old DnsHandler.php and it&#8217;s Dependencies<br>-Gute Issue / MR Beschreibung, vielleicht noch den Pfad zum DNS-Handler selbst ins issue schreiben<br>-Hätte ich nicht anders gemacht (2 Files gelöscht)</p>



<p class="has-small-font-size wp-block-paragraph"><strong>Remove DNS Tool button<br></strong>-Sehr gute Issue Beschreibung mit Image<br>-Sonst gut, alles nötige entfernt</p>



<p class="has-small-font-size wp-block-paragraph"><strong>Remove PC Vertrieb code<br></strong>-Issue Beschreibung gut, vielleicht noch reinschreiben, was PC vertrieb ist und macht?<br>-InvoicePdf.php:520/521 braucht es nur einen Check<br>-InvoicePdf und StornoPdf: getNotHosttechData($key) ist jetzt nur noch für transporter zuständing könnte man Inline machen.<br>-application/pdfs/images/pc_vertrieb.svg und application/pdfs/images/logo-pcvertrieb.png könnte man noch löschen<br>-Sonst gut</p>



<p class="has-small-font-size wp-block-paragraph">Some of these things are parts that I&#8217;ve not yet realized that those are important or matter much, so I have taken those points to mind and look for that I will not repeat those mistakes. While other things are things I know but overlooked or purposely ignored since based on things that I&#8217;ve observed. For example not deleting the images belonging to pc-vertrieb, those I didn&#8217;t delete on purpose since I knew that there are a good amount of old images which are not in use anymore floating around. But this I now know should nonetheless be deleted even if others didn&#8217;t.   <br><br>Now the reason for writing the &#8220;StornoPdf:getNotHosttechData($key)&#8221; inline is to shorten the code reducing redundance making it faster and  might even make it easier to understand.  This for example is something I overlooked  but I understand on how or well more so why you could and should do that.</p>



<h3 class="wp-block-heading has-medium-font-size">5th Task</h3>



<p class="has-small-font-size wp-block-paragraph">Now I&#8217;ve just completed my fifth task. This issue or well task was a interesting one since this was the first one where I added new code to the codebase. Now the task started out simple, &#8220;adjust the VNC password change text&#8221;, this was easily done it was inside a string-template where I just had to change the number in the text from 12 to 8. Now after that I went into the test wonderland to see if my changes are working as intended. Now I had a bit of a struggle to figure out how to get there exactly since it needed to be a vServer with certain conditions for the VNC to be active and I couldn&#8217;t just create one via the admin page since I didn&#8217;t have a option für the OS for example which meant I wasn&#8217;t able to create one. Now to fix that I had to manually add an option into the database, that I was able to do with the help of Manu. <br><br>Even after I was able to create the needed product the loading of the pages was very and I mean very inconsistent, because sometimes it showed a critical error or just never stopped loading then at times I got a timeout then a zend_session error and each of these option had a chance to appear each page I needed to load which it was like 6 or so before I reached my &#8220;destination&#8221;, meaning it took quite a moment until I was able to test it. <br>But after a while I was able to test it but during that I noticed something, that is that the validation is wrong and set for 12 characters still. So then I asked Simon if that is something that I should change as well to which the answer was yes.<br><br>So now I looked at the code inside the password-validator to see how one could fix it. Then firstly I just changes the text of the existing code to see if that is truly where the text came from which was the case. So now I had to think of a way to add a check or condition that if it&#8217;s loading the VNC password change popup then it needs to show and check for 8 instead of 12 characters. Now the easiest way I could think of was with an if statement, which I then went to try and implement.<br>First I thought of using DOM selectors to find an id or class to see if it&#8217;s loading the VNC password change popup. Now that was a step into the right direction I was just looking at the wrong files and therefor classes / id&#8217;s to check for. I tried 2 different variations one with an id the other with a class. Neither worked, so I went to look through the code again to see what else it could be which is when I stumbled over a certain code section which used an if statement with a check if it&#8217;s part of the VNC password form. Now when I saw that, I thought since it&#8217;s here it should or must work so why not give this a try and so I did and it worked. Here&#8217;s what it looks like:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>// before
if (sPW.length &lt; 12) { // checks is the password length is less than 12
    iPercent -= 10 * (12 - sPW.length) // takes away 10% of the bar for each missing letter
    bTooShort = true // sets the boolean from false to true (that the password is too short)
    if (sMessage === '') {// if the message is empty 
        sMessage = 'Mindestlänge 12 Zeichen' // sets the value of "sMessage" to "Mindestlänge 12 Zeichen"
    }
}
// after
if ($('.validatePW').closest('form').attr('id') == 'vnc-passwform') { // searched all elements with class "validatePW" then selects nearest parent "&lt;form>" or if there's multiple the first then select the id and compares it to the given string
    if (sPW.length &lt; 8) { // checks is the password length is less than 8
        iPercent -= 10 * (8 - sPW.length) // takes away 10% of the bar for each missing letter
        bTooShort = true // the same as above, same with the rest
        if (sMessage === '') {
            sMessage = 'Mindestlänge 8 Zeichen' // sets the value of "sMessage" to "Mindestlänge 8 Zeichen"
        }
    }
} else {
    if (sPW.length &lt; 12) {
        iPercent -= 10 * (12 - sPW.length)
        bTooShort = true
        if (sMessage === '') {
            sMessage = 'Mindestlänge 12 Zeichen'
        }
    }
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #616E88">// before</span></span>
<span class="line"><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">sPW</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">length </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">12</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// checks is the password length is less than 12</span></span>
<span class="line"><span style="color: #D8DEE9FF">    iPercent </span><span style="color: #81A1C1">-=</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">10</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">*</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #B48EAD">12</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> sPW</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">length</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// takes away 10% of the bar for each missing letter</span></span>
<span class="line"><span style="color: #D8DEE9FF">    bTooShort </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">true</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// sets the boolean from false to true (that the password is too short)</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">sMessage </span><span style="color: #81A1C1">===</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #616E88">// if the message is empty </span></span>
<span class="line"><span style="color: #D8DEE9FF">        sMessage </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">Mindestlänge 12 Zeichen</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// sets the value of &quot;sMessage&quot; to &quot;Mindestlänge 12 Zeichen&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #616E88">// after</span></span>
<span class="line"><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">$</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">.validatePW</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">.</span><span style="color: #88C0D0">closest</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">form</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">.</span><span style="color: #88C0D0">attr</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">id</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">==</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">vnc-passwform</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// searched all elements with class &quot;validatePW&quot; then selects nearest parent &quot;&lt;form&gt;&quot; or if there&#39;s multiple the first then select the id and compares it to the given string</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">sPW</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">length </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">8</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// checks is the password length is less than 8</span></span>
<span class="line"><span style="color: #D8DEE9FF">        iPercent </span><span style="color: #81A1C1">-=</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">10</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">*</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #B48EAD">8</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> sPW</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">length</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// takes away 10% of the bar for each missing letter</span></span>
<span class="line"><span style="color: #D8DEE9FF">        bTooShort </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">true</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// the same as above, same with the rest</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">sMessage </span><span style="color: #81A1C1">===</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">            sMessage </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">Mindestlänge 8 Zeichen</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// sets the value of &quot;sMessage&quot; to &quot;Mindestlänge 8 Zeichen&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #ECEFF4">}</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">sPW</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">length </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">12</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">        iPercent </span><span style="color: #81A1C1">-=</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">10</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">*</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #B48EAD">12</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> sPW</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">length</span><span style="color: #ECEFF4">)</span></span>
<span class="line"><span style="color: #D8DEE9FF">        bTooShort </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">true</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #D8DEE9FF">sMessage </span><span style="color: #81A1C1">===</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">            sMessage </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">Mindestlänge 12 Zeichen</span><span style="color: #ECEFF4">&#39;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">As mentioned above the testing took most of the time needed for this task / issue which was rather annoying since it was so inconsistent but after a good few nerves and a few hours I was able to do the final test and finish this task / issue as well. </p>



<p class="has-large-font-size wp-block-paragraph">Sequel I</p>



<p class="has-small-font-size wp-block-paragraph">I have now completed a good few tasks, the whole process got easier to a point where it goes automatically besides a label i forget to adjust in the issue after i did so in the merge request but asides that it&#8217;s pretty stuck in the meantime.</p>



<p class="has-small-font-size wp-block-paragraph">Now during these tasks i noticed something. I have a tendency to overlook a tiny detail or do something and then do another thing which contradicts what i just did. Here are a few examples:</p>



<p class="has-medium-font-size wp-block-paragraph">Example 1:<br>Using a variable which in the check above (if its true) won&#8217;t exist and then use that inside the check.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>if (is_null($cancellation)) {
    \Sentry\captureMessage('This cancellation: '. $cancellation .', does not exist anymore.');
    return $result;
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #88C0D0">is_null</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">cancellation</span><span style="color: #ECEFF4">))</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">\</span><span style="color: #88C0D0">Sentry</span><span style="color: #ECEFF4">\</span><span style="color: #88C0D0">captureMessage</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">This cancellation: </span><span style="color: #ECEFF4">&#39;</span><span style="color: #81A1C1">.</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">cancellation</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">.</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">, does not exist anymore.</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">result</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">As you can see I made an if statement which will trigger if the variable &#8220;$cancellation&#8221; is null. But right after i try to give that exact variable in an error message. This will of course not work because how can it output something which will be null (so nothing). <br>Here&#8217;s another Instance of this case:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>Folgende Produkte werden zu den angegebenen Daten gelscht:
&lt;?php if(count($this->products) > 0){ ?>
&lt;?php foreach($this->products as $data){?>
&lt;?php $product = $data&#91;"product"&#93;; $date = $data&#91;"date"&#93;;?>
- Produkt: &lt;?php echo $product->getFullDescription(); ?> zum &lt;?php echo DateHelper::formatDate($date); ?> 
&lt;?php if (is_null($product)) { ?>
Es gibt kein Produkt zu dieser Kndigung.
&lt;?php    \Sentry\captureMessage('Product: '. $product .', does not exist. For this cancellation: '. $this->cancellations->id .', There exists no product. '); ?>
&lt;?php } else { ?>

...</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">Folgende Produkte werden zu den angegebenen Daten gelscht</span><span style="color: #81A1C1">:</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #ECEFF4">(</span><span style="color: #88C0D0">count</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">products</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">0</span><span style="color: #ECEFF4">){</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">foreach</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">products</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">as</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">){</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">product</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">product</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">date</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> Produkt</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">product</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getFullDescription</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> zum </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">DateHelper</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">formatDate</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #88C0D0">is_null</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">product</span><span style="color: #ECEFF4">))</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">Es gibt kein Produkt zu dieser Kndigung</span><span style="color: #81A1C1">.</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php    </span><span style="color: #ECEFF4">\</span><span style="color: #88C0D0">Sentry</span><span style="color: #ECEFF4">\</span><span style="color: #88C0D0">captureMessage</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">Product: </span><span style="color: #ECEFF4">&#39;</span><span style="color: #81A1C1">.</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">product</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">.</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">, does not exist. For this cancellation: </span><span style="color: #ECEFF4">&#39;</span><span style="color: #81A1C1">.</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">cancellations</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">.</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">, There exists no product. </span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php } </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">...</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Here once more i added an if statement that triggers if the &#8220;$product&#8221; is null and the proceed to use it one line further down in an error message. </p>



<p class="wp-block-paragraph">Example 2:<br>Set the bracket in the wrong line.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>...// greetings

&lt;?php if(count($this->products) > 0){ ?> // this is the opening bracket
&lt;?php foreach($this->products as $data){?>
&lt;?php $product = $data&#91;"product"&#93;; $date = $data&#91;"date"&#93;;?>
- Produkt: &lt;?php echo $product->getFullDescription(); ?> zum &lt;?php echo DateHelper::formatDate($date); ?> 
&lt;?php if (is_null($product)) { ?>
Es gibt kein Produkt zu dieser Kndigung.
&lt;?php    \Sentry\captureMessage('No product exists for this cancellation:'. $this->cancellations->id); ?>
&lt;?php } else { ?>

- Produkt: &lt;?php echo $product->getFullDescription(); ?> zum &lt;?php echo DateHelper::formatDate($date); ?>
&lt;?php }?>
&lt;?php }?>
&lt;?php if(count($this->domains) > 0){?>
&lt;?php foreach($this->domains as $data){?>
&lt;?php $domain = $data&#91;"product"&#93;; $date = $data&#91;"date"&#93;;?>
- &lt;?php echo $domain->getFullDescription(); ?> zum &lt;?php echo DateHelper::formatDate($date); ?> 
&lt;?php }?>

...

&lt;?php if(...) {?>...&lt;?php } else {?>...&lt;?php }?> ...

&lt;?php foreach($this->domains as $data){?>
&lt;?php $domain = $data&#91;"product"&#93;; $date = $data&#91;"date"&#93;;?>
- &lt;?php echo $domain->getFullDescription(); ?>: &lt;?php echo $domain->authCode;?> 
&lt;?php }?>
&lt;?php }?>

... // regards

&lt;?php } ?> // this is the closing bracket</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">...</span><span style="color: #616E88">// greetings</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #ECEFF4">(</span><span style="color: #88C0D0">count</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">products</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">0</span><span style="color: #ECEFF4">){</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// this is the opening bracket</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">foreach</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">products</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">as</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">){</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">product</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">product</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">date</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> Produkt</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">product</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getFullDescription</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> zum </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">DateHelper</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">formatDate</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #88C0D0">is_null</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">product</span><span style="color: #ECEFF4">))</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">Es gibt kein Produkt zu dieser Kndigung</span><span style="color: #81A1C1">.</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php    </span><span style="color: #ECEFF4">\</span><span style="color: #88C0D0">Sentry</span><span style="color: #ECEFF4">\</span><span style="color: #88C0D0">captureMessage</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">No product exists for this cancellation:</span><span style="color: #ECEFF4">&#39;</span><span style="color: #81A1C1">.</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">cancellations</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php } </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> Produkt</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">product</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getFullDescription</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> zum </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">DateHelper</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">formatDate</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php }</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php }</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #ECEFF4">(</span><span style="color: #88C0D0">count</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">domains</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">0</span><span style="color: #ECEFF4">){</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">foreach</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">domains</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">as</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">){</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">domain</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">product</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">date</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">domain</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getFullDescription</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> zum </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">DateHelper</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">formatDate</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php }</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">...</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">...</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #81A1C1">?&gt;...&lt;?</span><span style="color: #D8DEE9FF">php } </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #81A1C1">?&gt;...&lt;?</span><span style="color: #D8DEE9FF">php }</span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">...</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">foreach</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">domains</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">as</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">){</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">domain</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">product</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">date</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">domain</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getFullDescription</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">domain</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">authCode</span><span style="color: #81A1C1">;?&gt;</span><span style="color: #D8DEE9FF"> </span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php }</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php }</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">...</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// regards</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php } </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// this is the closing bracket</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Here i put the closing bracket of the if function at the start at the bottom of everything. Now i didn&#8217;t notice that nor did i think that anything was wrong because when i tested the mail (which this is) everything looked right. But while this would&#8217;ve fixed the issue i was given it would have produced at least one new issue which is of course not the idea.<br>Now when you look closer you can see that there are two main parts to this mail: Products and Domains now in this case if there were no products the domains if there are any wouldn&#8217;t have been shown because of where the closing bracket is. So i moved it up just below where the product part of the mail is done, like so:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>... // greetings

&lt;?php if(count($this->products) > 0){ ?> // this is the opening bracket
&lt;?php foreach($this->products as $data){?>
&lt;?php $product = $data&#91;"product"&#93;; $date = $data&#91;"date"&#93;;?>
- Produkt: &lt;?php echo $product->getFullDescription(); ?> zum &lt;?php echo DateHelper::formatDate($date); ?> 
&lt;?php if (is_null($product)) { ?>
Es gibt kein Produkt zu dieser Kndigung.
&lt;?php    \Sentry\captureMessage('No product exists for this cancellation:'. $this->cancellations->id); ?>
&lt;?php } else { ?>

- Produkt: &lt;?php echo $product->getFullDescription(); ?> zum &lt;?php echo DateHelper::formatDate($date); ?>
&lt;?php }?>
&lt;?php }?>
&lt;?php } ?> // this is the closing bracket

&lt;?php if(count($this->domains) > 0){?>
&lt;?php foreach($this->domains as $data){?>
&lt;?php $domain = $data&#91;"product"&#93;; $date = $data&#91;"date"&#93;;?>
- &lt;?php echo $domain->getFullDescription(); ?> zum &lt;?php echo DateHelper::formatDate($date); ?> 
&lt;?php }?>

...

&lt;?php if(...) {?>...&lt;?php } else {?>...&lt;?php }?> ...

&lt;?php foreach($this->domains as $data){?>
&lt;?php $domain = $data&#91;"product"&#93;; $date = $data&#91;"date"&#93;;?>
- &lt;?php echo $domain->getFullDescription(); ?>: &lt;?php echo $domain->authCode;?> 
&lt;?php }?>
&lt;?php }?>

... // regards</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">...</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// greetings</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #ECEFF4">(</span><span style="color: #88C0D0">count</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">products</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">0</span><span style="color: #ECEFF4">){</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// this is the opening bracket</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">foreach</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">products</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">as</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">){</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">product</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">product</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">date</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> Produkt</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">product</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getFullDescription</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> zum </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">DateHelper</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">formatDate</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #88C0D0">is_null</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">product</span><span style="color: #ECEFF4">))</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">Es gibt kein Produkt zu dieser Kndigung</span><span style="color: #81A1C1">.</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php    </span><span style="color: #ECEFF4">\</span><span style="color: #88C0D0">Sentry</span><span style="color: #ECEFF4">\</span><span style="color: #88C0D0">captureMessage</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">No product exists for this cancellation:</span><span style="color: #ECEFF4">&#39;</span><span style="color: #81A1C1">.</span><span style="color: #88C0D0"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">cancellations</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php } </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> Produkt</span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">product</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getFullDescription</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> zum </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">DateHelper</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">formatDate</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php }</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php }</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php } </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// this is the closing bracket</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #ECEFF4">(</span><span style="color: #88C0D0">count</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">domains</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #B48EAD">0</span><span style="color: #ECEFF4">){</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">foreach</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">domains</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">as</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">){</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">domain</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">product</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">date</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">domain</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getFullDescription</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> zum </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">DateHelper</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">formatDate</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php }</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">...</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">...</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #81A1C1">?&gt;...&lt;?</span><span style="color: #D8DEE9FF">php } </span><span style="color: #81A1C1">else</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">{</span><span style="color: #81A1C1">?&gt;...&lt;?</span><span style="color: #D8DEE9FF">php }</span><span style="color: #81A1C1">?&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">...</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">foreach</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">domains</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">as</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">){</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">domain</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">product</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">date</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">data</span><span style="color: #ECEFF4">&#91;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">date</span><span style="color: #ECEFF4">&quot;</span><span style="color: #ECEFF4">&#93;</span><span style="color: #81A1C1">;?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">domain</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getFullDescription</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">domain</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">authCode</span><span style="color: #81A1C1">;?&gt;</span><span style="color: #D8DEE9FF"> </span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php }</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php }</span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">...</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// regards</span></span></code></pre></div>



<p class="wp-block-paragraph">Example 3:<br>Forgot to remove a variable from a Handler.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>protected $_oSambaHandler;</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">protected</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">_oSambaHandler</span><span style="color: #81A1C1">;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">I had to remove a Handler and i did so but in another file there was this little variable hiding. Now i could swear that this variable didn&#8217;t appear when i searched for &#8220;SambaHandler&#8221; with &#8220;Ctrl + Shift + F&#8221; (search in every file project wide). But there it was now one hint on which i could&#8217;ve / should&#8217;ve picked up on is that in the funtion where this variable is used it was combined with &#8220;$this&#8221; meaning that the variable was in this file. Here&#8217;s how that looked like:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>public function getSambaHandler()
    {
        if(empty($this->_oSambaHandler)) // here with this "$this->_oSambaHandler"
        {
            $oSSHHandler = $this->getSSHHandler();
            $this->_oSambaHandler = new \...\Samba\Handler($oSSHHandler); // and / or here
        }

        return $this->_oSambaHandler;
    }</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">getSambaHandler</span><span style="color: #ECEFF4">()</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">if</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">empty</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">_oSambaHandler</span><span style="color: #ECEFF4">))</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// here with this &quot;$this-&gt;_oSambaHandler&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oSSHHandler</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #88C0D0">getSSHHandler</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">            </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">_oSambaHandler</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">new</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">\</span><span style="color: #81A1C1">...</span><span style="color: #ECEFF4">\</span><span style="color: #88C0D0">Samba</span><span style="color: #ECEFF4">\</span><span style="color: #88C0D0">Handler</span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">oSSHHandler</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// and / or here</span></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #ECEFF4">}</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">        </span><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">_oSambaHandler</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #ECEFF4">}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">So what is to learn from this is to always thoroughly read the code and double check before committing the changes. Something that also might help to avoid such mistakes it to take a quick break or do something else for the mind to focus on because this way instead of just reading it over and over again back to back can make it so you overlook the same part each time. But with the short mental break or divergence of a task it can help refresh the mind and spot things you might&#8217;ve overlooked before.</p>



<p class="has-small-font-size wp-block-paragraph">Something else to watch out for is that you make a call to the db (database) the least amount of times possible. Because this is generally what makes the website slow to load. Instead use the models or a variable in which the data from the database is already stored in. Here&#8217;s an example:</p>



<p class="wp-block-paragraph">Instead of this:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;h3>Userdata&lt;/h3>

  &lt;?php $user = $this->order->getUser() ?: $this->order->getUserdata(); ?>
  
	&lt;table>
  &lt;?php if ($this->order->getUser()) : ?>
		  &lt;tr>
			  &lt;td width=263>Kunden-Nummer:&lt;/td>
		    &lt;td style="font-family: 'Americane-Bold';">&lt;?php echo $user->id; ?>&lt;/td>
    &lt;/tr>
&lt;?php endif; ?></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h3</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">Userdata</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h3</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">user</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">order</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getUser</span><span style="color: #ECEFF4">()</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">order</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getUserdata</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span></span>
<span class="line"><span style="color: #D8DEE9FF">	</span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">table</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">order</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getUser</span><span style="color: #ECEFF4">())</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">		  </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">tr</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">			  </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">td width</span><span style="color: #81A1C1">=</span><span style="color: #B48EAD">263</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">Kunden</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">Nummer</span><span style="color: #81A1C1">:&lt;/</span><span style="color: #D8DEE9FF">td</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">		    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">td style</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">font-family: &#39;Americane-Bold&#39;;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">user</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;&lt;/</span><span style="color: #D8DEE9FF">td</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">tr</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">endif;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span></code></pre></div>



<p class="wp-block-paragraph">Do this:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&lt;h3>Userdata&lt;/h3>
	
  &lt;?php $user = $this->order->getUser() ?: $this->order->getUserdata(); ?>
					
	&lt;table>
  &lt;?php if ($user instanceof User) : ?>
			&lt;tr>
					&lt;td width=263>Kunden-Nummer:&lt;/td>
			    &lt;td style="font-family: 'Americane-Bold';">&lt;?php echo $user->id; ?>&lt;/td>
	    &lt;/tr>
  &lt;?php endif; ?></textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">h3</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">Userdata</span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">h3</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">	</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">user</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">order</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getUser</span><span style="color: #ECEFF4">()</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$this-&gt;</span><span style="color: #D8DEE9">order</span><span style="color: #81A1C1">-&gt;</span><span style="color: #88C0D0">getUserdata</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">					</span></span>
<span class="line"><span style="color: #D8DEE9FF">	</span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">table</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">if</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">(</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">user</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">instanceof</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">User</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">			</span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">tr</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">					</span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">td width</span><span style="color: #81A1C1">=</span><span style="color: #B48EAD">263</span><span style="color: #81A1C1">&gt;</span><span style="color: #D8DEE9FF">Kunden</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">Nummer</span><span style="color: #81A1C1">:&lt;/</span><span style="color: #D8DEE9FF">td</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">			    </span><span style="color: #81A1C1">&lt;</span><span style="color: #D8DEE9FF">td style</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">font-family: &#39;Americane-Bold&#39;;</span><span style="color: #ECEFF4">&quot;</span><span style="color: #81A1C1">&gt;&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">echo</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">user</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">id</span><span style="color: #81A1C1">;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;&lt;/</span><span style="color: #D8DEE9FF">td</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">	    </span><span style="color: #81A1C1">&lt;/</span><span style="color: #D8DEE9FF">tr</span><span style="color: #81A1C1">&gt;</span></span>
<span class="line"><span style="color: #D8DEE9FF">  </span><span style="color: #81A1C1">&lt;?</span><span style="color: #D8DEE9FF">php </span><span style="color: #81A1C1">endif;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">?&gt;</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">This checks if the data from the variable &#8220;$user&#8221; is a instance of the &#8220;User Model&#8221;. This does the same but you don&#8217;t make a call to the database for a second time.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>configuration</title>
		<link>https://flurin-lernjournal.hosttech.ch/config/</link>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Tue, 16 Sep 2025 14:59:23 +0000</pubDate>
				<category><![CDATA[Befehle]]></category>
		<category><![CDATA[Erklärungen]]></category>
		<category><![CDATA[hosttech]]></category>
		<category><![CDATA[Lernjournal]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://flurin-lernjournal.hosttech.ch/?p=1209</guid>

					<description><![CDATA[A config.ini file is a simple configuration file where you store settings outside of your code so they’re easy to manage and change without editing the source. Structure: Here&#8217;s an example of an config.ini file: What you define in them: Laravel Now in Laravel it works a bit differently, instead of config (configuration) files it [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="has-small-font-size wp-block-paragraph">A <strong><code>config.ini</code> file</strong> is a simple configuration file where you store settings outside of your code so they’re easy to manage and change without editing the source.</p>



<p class="wp-block-paragraph"><strong>Structure:</strong></p>



<ul class="wp-block-list">
<li class="has-small-font-size">It’s text-based and usually divided into <strong>sections</strong> with <code>[brackets]</code>.</li>



<li class="has-small-font-size">Each section contains <strong>key = value</strong> pairs.</li>
</ul>



<p class="has-small-font-size wp-block-paragraph">Here&#8217;s an example of an config.ini file:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>&#91;database&#93;
host = localhost
user = myuser
password = secret
dbname = mydb

&#91;app&#93;
debug = true</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #ECEFF4">&#91;</span><span style="color: #D8DEE9FF">database</span><span style="color: #ECEFF4">&#93;</span></span>
<span class="line"><span style="color: #D8DEE9FF">host </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> localhost</span></span>
<span class="line"><span style="color: #D8DEE9FF">user </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> myuser</span></span>
<span class="line"><span style="color: #D8DEE9FF">password </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> secret</span></span>
<span class="line"><span style="color: #D8DEE9FF">dbname </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> mydb</span></span>
<span class="line"></span>
<span class="line"><span style="color: #ECEFF4">&#91;</span><span style="color: #D8DEE9FF">app</span><span style="color: #ECEFF4">&#93;</span></span>
<span class="line"><span style="color: #D8DEE9FF">debug </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">true</span></span></code></pre></div>



<p class="wp-block-paragraph"><strong>What you define in them:</strong></p>



<ul class="wp-block-list has-small-font-size">
<li>Database credentials</li>



<li>API keys</li>



<li>File paths</li>



<li>App settings (debug mode, language, etc.)</li>
</ul>



<h3 class="wp-block-heading has-medium-font-size">Laravel</h3>



<p class="has-small-font-size wp-block-paragraph">Now in Laravel it works a bit differently, instead of config (configuration) files it uses .env (environment) files.<br>They are built rather similar they also use &#8220;key = value&#8221; pairs.</p>



<p class="has-small-font-size wp-block-paragraph">Here&#8217;s how an example of a .env file:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>APP_NAME="MyApp"
APP_ENV=local
APP_DEBUG=true
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mydb
DB_USERNAME=myuser
DB_PASSWORD=secret

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9FF">APP_NAME</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&quot;</span><span style="color: #A3BE8C">MyApp</span><span style="color: #ECEFF4">&quot;</span></span>
<span class="line"><span style="color: #D8DEE9FF">APP_ENV</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF">local</span></span>
<span class="line"><span style="color: #D8DEE9FF">APP_DEBUG</span><span style="color: #81A1C1">=true</span></span>
<span class="line"><span style="color: #D8DEE9FF">APP_URL</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF">http</span><span style="color: #81A1C1">:</span><span style="color: #616E88">//localhost</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">DB_CONNECTION</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF">mysql</span></span>
<span class="line"><span style="color: #D8DEE9FF">DB_HOST</span><span style="color: #81A1C1">=</span><span style="color: #B48EAD">127</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">0</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">0</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">1</span></span>
<span class="line"><span style="color: #D8DEE9FF">DB_PORT</span><span style="color: #81A1C1">=</span><span style="color: #B48EAD">3306</span></span>
<span class="line"><span style="color: #D8DEE9FF">DB_DATABASE</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF">mydb</span></span>
<span class="line"><span style="color: #D8DEE9FF">DB_USERNAME</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF">myuser</span></span>
<span class="line"><span style="color: #D8DEE9FF">DB_PASSWORD</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF">secret</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF">MAIL_MAILER</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF">smtp</span></span>
<span class="line"><span style="color: #D8DEE9FF">MAIL_HOST</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF">smtp</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">mailtrap</span><span style="color: #81A1C1">.</span><span style="color: #D8DEE9FF">io</span></span>
<span class="line"><span style="color: #D8DEE9FF">MAIL_PORT</span><span style="color: #81A1C1">=</span><span style="color: #B48EAD">2525</span></span>
<span class="line"><span style="color: #D8DEE9FF">MAIL_USERNAME</span><span style="color: #81A1C1">=null</span></span>
<span class="line"><span style="color: #D8DEE9FF">MAIL_PASSWORD</span><span style="color: #81A1C1">=null</span></span>
<span class="line"><span style="color: #D8DEE9FF">MAIL_ENCRYPTION</span><span style="color: #81A1C1">=null</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">The main difference is that you write the keys in uppercase with &#8220;_&#8221;. Same as a config file you also define the following:</p>



<ul class="wp-block-list has-small-font-size">
<li>Database credentials</li>



<li>API keys</li>



<li>File paths</li>



<li>App settings (debug mode, language, etc.)</li>
</ul>



<h2 class="wp-block-heading has-large-font-size">Here&#8217;s how we would do it at hosttech:</h2>



<h3 class="wp-block-heading has-medium-font-size">Wonderland</h3>



<p class="has-small-font-size wp-block-paragraph">In Wonderland we use something called &#8220;object-style access&#8221; to get data from the config files. The Zend framework provides a way to easily read the information out of config files. You load the file into a object then you can access as mentioned before with the &#8220;object-style access&#8221;. Now while this is quite handy it also means that if you can&#8217;t call the framework or if there&#8217;s a problem your code also can&#8217;t access the config file usually meaning that the whole page will be down or at least part of it. Now while it can work without the autoloader it&#8217;s a lot more code you need otherwise since then you would need to call &#8220;require_once &#8216;Zend/Config/Ini.php&#8217;;&#8221; before each time you want to access something from the config file. With the autoloader you can just set it up once which is quite handy.<br>Here&#8217;s how the config file &#8220;can&#8221; look like:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="673" height="470" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2025/09/config.png" alt="" class="wp-image-1221" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2025/09/config.png 673w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2025/09/config-300x210.png 300w" sizes="auto, (max-width: 673px) 100vw, 673px" /></figure>



<p class="has-small-font-size wp-block-paragraph">Now to access something you save the data in a variable &#8220;$config&#8221; like so:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>// set up the autoloader 
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();

$config = WonderlandRegistry::getConfig();

// getConfig() function
public static function getConfig()
{
    return self::get('config');
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #616E88">// set up the autoloader </span></span>
<span class="line"><span style="color: #81A1C1">require_once</span><span style="color: #D8DEE9FF"> </span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">Zend/Loader/Autoloader.php</span><span style="color: #ECEFF4">&#39;</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #8FBCBB">Zend_Loader_Autoloader</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">getInstance</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">config</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #8FBCBB">WonderlandRegistry</span><span style="color: #81A1C1">::</span><span style="color: #88C0D0">getConfig</span><span style="color: #ECEFF4">()</span><span style="color: #81A1C1">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #616E88">// getConfig() function</span></span>
<span class="line"><span style="color: #81A1C1">public</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">static</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">function</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">getConfig</span><span style="color: #ECEFF4">()</span></span>
<span class="line"><span style="color: #ECEFF4">{</span></span>
<span class="line"><span style="color: #D8DEE9FF">    </span><span style="color: #81A1C1">return</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">self::</span><span style="color: #88C0D0">get</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">config</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #81A1C1">;</span></span>
<span class="line"><span style="color: #ECEFF4">}</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">Now after you saved the data in the variable you can access it&#8217;s values like so:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>// in the config file dns.url = ...
.$config->dns->url.

// or an example with the image above
.$config->maintanance->status.</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #616E88">// in the config file dns.url = ...</span></span>
<span class="line"><span style="color: #81A1C1">.</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">config</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">dns</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">url</span><span style="color: #81A1C1">.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #616E88">// or an example with the image above</span></span>
<span class="line"><span style="color: #81A1C1">.</span><span style="color: #81A1C1">$</span><span style="color: #D8DEE9">config</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">maintanance</span><span style="color: #81A1C1">-&gt;</span><span style="color: #D8DEE9">status</span><span style="color: #81A1C1">.</span></span></code></pre></div>



<h3 class="wp-block-heading has-medium-font-size">myhosttech</h3>



<p class="has-small-font-size wp-block-paragraph">Now since the myhosttech part uses Laravel it uses .env files instead of config files. <br>Here&#8217;s how it &#8220;can&#8221; look like:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="599" height="322" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2025/09/env.png" alt="" class="wp-image-1220" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2025/09/env.png 599w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2025/09/env-300x161.png 300w" sizes="auto, (max-width: 599px) 100vw, 599px" /></figure>



<p class="has-small-font-size wp-block-paragraph">Now in myhosttech it works a bit different on how you access those values. You access the data saved in the .env file through config files, meaning that you for example have a config file called &#8220;services.php&#8221;  in which you save something under the key-name &#8220;token&#8221; and then set the value of said token to what stand in the .env file. So in the code you call the path to the token stored in the config file, not directly the .env file.<br>Here&#8217;s how that looks like:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>// call to the config file to the specified key
config('services.cloudtalk.myhosttech.api.token') // services file->cloudtalk->myhosttech->api->token

// said key in the services.php file
'token' => env('CLOUDTALK_MYHOSTTECH_API_TOKEN')

// value stored in the .env file (empty on purpose but would have a value normally)
CLOUDTALK_MYHOSTTECH_API_TOKEN= ...</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #616E88">// call to the config file to the specified key</span></span>
<span class="line"><span style="color: #88C0D0">config</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">services.cloudtalk.myhosttech.api.token</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span><span style="color: #D8DEE9FF"> </span><span style="color: #616E88">// services file-&gt;cloudtalk-&gt;myhosttech-&gt;api-&gt;token</span></span>
<span class="line"></span>
<span class="line"><span style="color: #616E88">// said key in the services.php file</span></span>
<span class="line"><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">token</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">=&gt;</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">env</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">CLOUDTALK_MYHOSTTECH_API_TOKEN</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span></span>
<span class="line"></span>
<span class="line"><span style="color: #616E88">// value stored in the .env file (empty on purpose but would have a value normally)</span></span>
<span class="line"><span style="color: #D8DEE9FF">CLOUDTALK_MYHOSTTECH_API_TOKEN</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">...</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">You could also directly access it from the .env file like so:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0">PHP</span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>env('CLOUDTALK_MYHOSTTECH_API_TOKEN')</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #88C0D0">env</span><span style="color: #ECEFF4">(</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">CLOUDTALK_MYHOSTTECH_API_TOKEN</span><span style="color: #ECEFF4">&#39;</span><span style="color: #ECEFF4">)</span></span></code></pre></div>



<p class="has-small-font-size wp-block-paragraph">There are a few reasons on why you go through config files instead of directly accessing the .env file, some are that it&#8217;s easier to understand when you look at the code and another is that then it&#8217;s easier to look something up or change something since it&#8217;s grouped in the config files. Meaning that you don&#8217;t have to look through all the .env files which can get rather long. <br>There&#8217;s also a security aspect to this, it makes it so that only specifically chosen variables become part of the apps usable config. This also means that if someone manages to temper with the .env file that it would only affect on the values of the config files not the real .env file.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Myhosttech and Wonderland</title>
		<link>https://flurin-lernjournal.hosttech.ch/myhosttech-amdwonderland/</link>
		
		<dc:creator><![CDATA[Admin]]></dc:creator>
		<pubDate>Mon, 08 Sep 2025 11:56:05 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Erklärungen]]></category>
		<category><![CDATA[hosttech]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Lernjournal]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wonderland]]></category>
		<guid isPermaLink="false">https://flurin-lernjournal.hosttech.ch/?p=1174</guid>

					<description><![CDATA[URL build example: &#8220;myhosttech.test/admin-inventory/systems&#8221; The text after the first &#8220;/&#8221; so &#8220;admin-inventory&#8221; is the controller so in this instance &#8220;AdminInventoryController.php&#8221;.The text after the second &#8220;/&#8221; so &#8220;systems&#8221; is the function inside said controller, though here to note is that it might be a shortened version since in this instance the function is &#8220;systemsAction&#8221;. Myhosttech Framework:&#160;LaravelConfig-File:&#160;.env [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading has-large-font-size">URL build</h2>



<p class="has-small-font-size wp-block-paragraph">example: &#8220;myhosttech.test/admin-inventory/systems&#8221;</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="740" src="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2025/09/hosttech-url-1024x740.png" alt="" class="wp-image-1591" srcset="https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2025/09/hosttech-url-1024x740.png 1024w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2025/09/hosttech-url-300x217.png 300w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2025/09/hosttech-url-768x555.png 768w, https://flurin-lernjournal.hosttech.ch/wp-content/uploads/2025/09/hosttech-url.png 1365w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="has-small-font-size wp-block-paragraph">The text after the first &#8220;/&#8221; so &#8220;admin-inventory&#8221; is the controller so in this instance &#8220;AdminInventoryController.php&#8221;.<br>The text after the second &#8220;/&#8221; so &#8220;systems&#8221; is the function inside said controller, though here to note is that it might be a shortened version since in this instance the function is &#8220;systemsAction&#8221;.</p>



<h2 class="wp-block-heading has-large-font-size">Myhosttech</h2>



<p class="has-small-font-size wp-block-paragraph"><strong>Framework:</strong>&nbsp;Laravel<br><strong>Config-File:</strong>&nbsp;<code>.env</code></p>



<h3 class="wp-block-heading has-medium-font-size">Where to find the Folders?</h3>



<p class="has-small-font-size wp-block-paragraph"><strong>Models</strong>: app/models/<br><strong>View</strong>: resources/views/ (NAME.blade.php)<br><strong>Controller</strong>: app/Api/Wonderland/User/v1/Controllers/<br><strong>Livewire</strong>: app/Http/Livewire/<br><strong>Livewire-Views</strong>: resources/views/livewire/</p>



<h2 class="wp-block-heading has-large-font-size">Wonderland</h2>



<p class="has-small-font-size wp-block-paragraph"><strong>Framework:</strong>&nbsp;Zend 1<br><strong>Config-File:</strong>&nbsp;<code>application/configuration/config.ini</code></p>



<h3 class="wp-block-heading has-medium-font-size">Where to find the Folders?</h3>



<p class="has-small-font-size wp-block-paragraph"><strong>Models</strong>: application/models<br><strong>View</strong>: application/views/ (.phtml files get their data from the controllers)<br><strong>Controller</strong>: application/controllers/</p>



<p class="has-medium-font-size wp-block-paragraph">Wonderland (admin):</p>



<p class="has-small-font-size wp-block-paragraph"><strong>View</strong>: application/views/<br><strong>Controller</strong>: application/controllers/</p>



<figure class="wp-block-table is-style-regular"><table><thead><tr><th class="has-text-align-center" data-align="center">Code</th><th class="has-text-align-center" data-align="center"><strong>Website (URL and / or Image)</strong></th><th class="has-text-align-center" data-align="center"><strong>Documentation</strong></th></tr></thead><tbody><tr><td class="has-text-align-center" data-align="center">View: <br>scripts/admin/index.phtml<br>Controller: <br>AdminController.php </td><td class="has-text-align-center" data-align="center">&#8216;/&#8217; =&gt; &#8216;/admin&#8217;<br>&#8216;/admin&#8217; =&gt; &#8216;/admin&#8217;<br>&#8216;/admin/index&#8217; =&gt; &#8216;/admin&#8217;</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin/externallinks.phtml<br>Controller:</td><td class="has-text-align-center" data-align="center">&#8216;/admin/externallinks&#8217; =&gt; &#8216;/admin/externallinks&#8217;<br>&#8216;/admin/externallinks#&#8217; =&gt; &#8216;/admin/externallinks#&#8217;</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-tickets/index.phtml<br>Controller:    <br>AdminTicketsController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-tickets&#8217; =&gt; &#8216;/admin-tickets/tickets&#8217;<br>&#8216;/admin-tickets/faqintern&#8217; =&gt; &#8216;/admin-tickets/faqintern&#8217;<br>&#8216;/admin-tickets/helpdesk&#8217; =&gt; &#8216;/admin-tickets/helpdesk&#8217;</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/page/admin-interface" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/page/admin-interface" target="_blank" rel="noreferrer noopener">Tickets</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-statistics/general.phtml<br>Controller: <br>AdminStatisticsController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-statistics&#8217; =&gt; &#8216;/admin-statistics/general&#8217;<br>&#8216;/admin-statistics/temperaturedatacenter&#8217; =&gt; <br>&#8216;/admin-statistics/temperaturedatacenter&#8217;</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-accounts/addressrequest.phtml<br>Controller: <br>AdminAccountsController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-accounts/addressrequests&#8217; =&gt; <br>&#8216;/admin-accounts/addressrequests&#8217;</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-users/search.phtml<br>Controller:<br>AdminAccountsController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-users/search&#8217; =&gt; &#8216;/admin-users/search&#8217;</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-domains/overview.phtml<br>Controller:<br>AdminDomainsController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-domains/overview&#8217; =&gt; &#8216;/admin-domains/overview&#8217;</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/domains" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/domains" target="_blank" rel="noreferrer noopener">domains</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-orders/order.phtml<br>Controller:<br>AdminOrdersController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-orders&#8217; =&gt; &#8216;/admin-orders/orders&#8217;</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/orders" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/orders" target="_blank" rel="noreferrer noopener">orders </a>&amp; <br><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/order-configurator" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/order-configurator" target="_blank" rel="noreferrer noopener">order config</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-servers/index.phtml<br>Controller:<br>AdminServersController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-servers&#8217; =&gt; &#8216;/admin-servers&#8217;</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/vserverdedicated-server" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/vserverdedicated-server" target="_blank" rel="noreferrer noopener">server</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-website/agb.phtml<br>Controller:<br>AdminWebsiteController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-website&#8217; =&gt; &#8216;/admin-website/&#8217;<br>&#8216;/admin-website/&#8217; =&gt; &#8216;/admin-website/&#8217;</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-dns/administration.phtml<br>Controller:<br>AdminDnsController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-dns&#8217; =&gt; &#8216;/admin-dns&#8217;<br>&#8216;/admin-dns/&#8217; =&gt; &#8216;/admin-dns/&#8217;</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-inventory/search.phtml<br>Controller:<br>AdminInventoryController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-inventory&#8217; =&gt; &#8216;/admin-inventory/search&#8217;</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/inventory" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/inventory" target="_blank" rel="noreferrer noopener">inventory</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-settings/general.phtml<br>Controller:<br>AdminSettingsController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-settings&#8217; =&gt; &#8216;/admin-settings/general&#8217;</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-debug/index.phtml<br>Controller:<br>AdminDebugController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-debug&#8217; =&gt; &#8216;/admin-debug&#8217;</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-calendar/index.phtml<br>Controller:<br>AdminCalendarController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-calendar&#8217; =&gt; &#8216;/admin-calendar&#8217;</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/admin-accounting/index.phtml or <br>paymentsin.phtml<br>Controller:<br>AdminAccountingController.php</td><td class="has-text-align-center" data-align="center">&#8216;/admin-accounting&#8217; =&gt; &#8216;/admin-accounting/paymentsin&#8217;</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/page/accounting-statistics" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/page/accounting-statistics" target="_blank" rel="noreferrer noopener">accounting</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>scripts/auth/<br>Controller:<br>AuthController.php</td><td class="has-text-align-center" data-align="center">&#8216;/auth/logout&#8217; =&gt; &#8216;/auth/logout&#8217;</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/page/authentication" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/page/authentication" target="_blank" rel="noreferrer noopener">auth</a></td></tr></tbody></table></figure>



<p class="wp-block-paragraph">Myhosttech(user):</p>



<p class="has-small-font-size wp-block-paragraph"><strong>View</strong>: resources/views/ (NAME.blade.php)</p>



<figure class="wp-block-table"><table><thead><tr><th class="has-text-align-center" data-align="center">Code</th><th class="has-text-align-center" data-align="center"><strong>Website (URL and / or Image)</strong></th><th class="has-text-align-center" data-align="center">Documentation</th></tr></thead><tbody><tr><td class="has-text-align-center" data-align="center">View:<br>layouts/_user-layout.blade.php</td><td class="has-text-align-center" data-align="center">/user</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>layouts/order.blade.php</td><td class="has-text-align-center" data-align="center">/user-products/order</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/orders" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/orders" target="_blank" rel="noreferrer noopener">orders</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>layouts/livewire/domain-search/domain.blade.php</td><td class="has-text-align-center" data-align="center">/user-domains</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/domains" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/domains" target="_blank" rel="noreferrer noopener">domains</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>layouts/livewire/domains/search-gpt/answer.blade.php</td><td class="has-text-align-center" data-align="center">/user/domains/search-gpt</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/page/openai" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/page/openai" target="_blank" rel="noreferrer noopener">gpt</a></td></tr><tr><td class="has-text-align-center" data-align="center">View: maybe<br>components/order-configurator/domains/free-transfer-info.blade.php</td><td class="has-text-align-center" data-align="center">/user-domains/transferinfos</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/domains" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/domains" target="_blank" rel="noreferrer noopener">domains</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>config:<br>config/nameservers.php</td><td class="has-text-align-center" data-align="center">/user-domains/chnameservers</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/domains" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/domains" target="_blank" rel="noreferrer noopener">domains</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>livewire/pages/customer/ticketsystem.blade.php</td><td class="has-text-align-center" data-align="center">/user/ticketsystem</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/page/customer-interface" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/page/customer-interface" target="_blank" rel="noreferrer noopener">tickets</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>livewire/pages/customer/contracts.blade.php</td><td class="has-text-align-center" data-align="center">/user/contracts</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>livewire/pages/customer/billing/invoices/all.blade.php</td><td class="has-text-align-center" data-align="center">/user/billing/invoices/all</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/billing" data-type="link" data-id="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/billing" target="_blank" rel="noreferrer noopener">Billing</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>livewire/pages/customer/billing/account/history.blade.php</td><td class="has-text-align-center" data-align="center">/user/billing/account/history</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/billing" target="_blank" rel="noreferrer noopener">Billing</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>livewire/pages/customer/billing/payment-methods.blade.php</td><td class="has-text-align-center" data-align="center">/user/billing/payment-methods</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/billing" target="_blank" rel="noreferrer noopener">Billing</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>livewire/pages/customer/invoice/settings.blade.php</td><td class="has-text-align-center" data-align="center">/user/billing/settings</td><td class="has-text-align-center" data-align="center"><a href="https://bookstack.hosttech.eu/books/wonderland-documentation/chapter/billing" target="_blank" rel="noreferrer noopener">Billing</a></td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>livewire/pages/customer/affiliate/dashboard.blade.php</td><td class="has-text-align-center" data-align="center">/user/affiliate</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>livewire/pages/customer/affiliate/promotions.blade.php</td><td class="has-text-align-center" data-align="center">/user/affiliate/promotions</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>livewire/pages/customer/affiliate/material.blade.php</td><td class="has-text-align-center" data-align="center">/user/affiliate/material</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr><tr><td class="has-text-align-center" data-align="center">View:<br>livewire/pages/customer/faq.blade.php</td><td class="has-text-align-center" data-align="center">/user/faq</td><td class="has-text-align-center" data-align="center">&#8211;</td></tr></tbody></table></figure>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
