chapter hgroup + calming decor

This commit is contained in:
Julie Blanc 2026-04-07 18:09:15 +02:00
parent 0545b131de
commit 94d14d70c1
370 changed files with 9583 additions and 1566 deletions

View file

@ -25,6 +25,25 @@ class PageUuid extends ModelUuid
*/
public Identifiable|null $model = null;
/**
* Removes the current UUID from cache,
* recursively including all children if needed
*/
public function clear(bool $recursive = false): bool
{
/**
* If $recursive, also clear UUIDs from cache for all children
* @var \Kirby\Cms\Page $model
*/
if ($recursive === true && $model = $this->model()) {
foreach ($model->children() as $child) {
$child->uuid()->clear(true);
}
}
return parent::clear();
}
/**
* Looks up UUID in cache and resolves
* to page object
@ -55,6 +74,27 @@ class PageUuid extends ModelUuid
}
}
/**
* Feeds the UUID for the page (and optionally
* its children) into the cache
*/
public function populate(
bool $force = false,
bool $recursive = false
): bool {
/**
* If $recursive, also populate UUIDs for all children
* @var \Kirby\Cms\Page $model
*/
if ($recursive === true && $model = $this->model()) {
foreach ($model->children() as $child) {
$child->uuid()->populate($force, true);
}
}
return parent::populate($force);
}
/**
* Returns permalink url
*/

View file

@ -100,18 +100,8 @@ abstract class Uuid implements Stringable
* Removes the current UUID from cache,
* recursively including all children if needed
*/
public function clear(bool $recursive = false): bool
public function clear(): bool
{
// For all models with children: if $recursive,
// also clear UUIDs from cache for all children
if ($recursive === true && $model = $this->model()) {
if (method_exists($model, 'children') === true) {
foreach ($model->children() as $child) {
$child->uuid()->clear(true);
}
}
}
if ($key = $this->key()) {
return Uuids::cache()->remove($key);
}

View file

@ -19,6 +19,11 @@ use Kirby\Exception\LogicException;
*/
class Uuids
{
/**
* Cache for the uuid option state
*/
public static bool|null $enabled = null;
/**
* Returns the instance for the lookup cache
*/
@ -82,7 +87,7 @@ class Uuids
public static function enabled(): bool
{
return App::instance()->option('content.uuid') !== false;
return static::$enabled ??= App::instance()->option('content.uuid') !== false;
}
/**