Skip to content

Commit 45ecddd

Browse files
committed
refactor(container): Update content retrieval to use containerRef
- Replaced direct access to container attributes with containerRef for improved clarity. - Simplified contentlet retrieval by utilizing containerRef instead of pageAsset.
1 parent 8895df4 commit 45ecddd

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

instructions/guide.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -760,15 +760,14 @@ $containerAttrs = [
760760
'data-dot-object' => 'container',
761761
'data-dot-identifier' => $identifier,
762762
'data-dot-uuid' => $uuid,
763-
'data-dot-accept-types' => $container->acceptTypes ?? '',
764-
'data-max-contentlets' => $container->maxContentlets ?? 0
763+
'data-dot-accept-types' => $containerRef->acceptTypes ?? '',
764+
'data-max-contentlets' => $containerRef->maxContentlets ?? 0
765765
];
766766

767767
?>
768768
<div<?= $containerAttrs ?>>
769769
<?php
770-
// Note: dotCMS stores contentlets with a "uuid-" prefix in lowercase
771-
$contentlets = $pageAsset->containers[$identifier]->contentlets[strtolower("uuid-" . $uuid)] ?? null;
770+
$contentlets = $containerRef->contentlets
772771

773772
if ($contentlets) {
774773
foreach ($contentlets as $contentlet) {

0 commit comments

Comments
 (0)