Skip to content

Instantly share code, notes, and snippets.

Loop through your Matrix blocks.
{% for block in entry.matrixField %}
Find the block you're looking for.
{% if block.type == 'myBlockHandle' %}
Make sure there are actually some images/assets select
{% if block.myAssetField | length %}
Loop through the assets
<ul>
{% set alreadyUsedTags = [] %}
{% for entry in craft.entries.section('databytes').limit(null).find() %}
{% set series = entry.series %}
{% if series | length %}
{# What do I add to this for loop to just display the first entry that has the same tag? #}
{% for series in series %}
{% if series not in alreadyUsedTags %}
<input type="{{ interestedin.value }}" value="checked" name="fields[interests][]" {% if checked %}checked="checked"{% endif %}>
<?php
namespace Craft;
// Set default timezone to UTC
date_default_timezone_set('UTC');
ini_set('log_errors', 1);
error_reporting(E_ALL & ~E_STRICT);
ini_set('display_errors', 1);

Keybase proof

I hereby claim:

  • I am takobell on github.
  • I am takobell (https://keybase.io/takobell) on keybase.
  • I have a public key whose fingerprint is 9302 1E27 AE90 866A 51E7 A7B1 0682 19F2 F720 99F8

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am angrybrad on github.
  • I am takobell (https://keybase.io/takobell) on keybase.
  • I have a public key ASDJlOnxuU7XifxOfBKQ3EB4wZW8AmhFMeR33nr0aMg7vAo

To claim this, I am signing this object:

<?php
return [
'currencySymbols' => [
'JPY' => '¥',
],
];
Event::on(
Users::class,
Users::EVENT_AFTER_ACTIVATE_USER,
function ($event) {
if ($event->user->isInGroup('groupHandle')) {
Craft::$app->getConfig()->getGeneral()->postLoginRedirect = 'specialUserGroupPage';
// redirect to page A
} else {
// redirect to default page
<img src=x onerror=alert('caption')>
function textEncoderEncode($inputString) {
// Convert the string to UTF-8 encoding
$utf8String = mb_convert_encoding($inputString, 'UTF-8');
// Split the string into an array of characters
$characters = preg_split('//u', $utf8String, null, PREG_SPLIT_NO_EMPTY);
// Convert each character to its ASCII value
$encodedArray = array_map('ord', $characters);