Skip to content

Commit 5a2f00f

Browse files
committed
refactor(container): Simplify content retrieval in container templates
- Removed unnecessary UUID handling and streamlined contentlet access directly from containerRef. - Updated related documentation to reflect changes in content handling.
1 parent 153bbfd commit 5a2f00f

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

examples/dotcms-php/templates/partials/container.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
global $pageAsset;
88

99
$identifier = $containerRef->identifier ?? null;
10-
$uuid = $containerRef->uuid ?? null;
11-
12-
// Note: dotCMS stores contentlets with a "uuid-" prefix in lowercase
13-
$contentlets = $pageAsset->containers[$identifier]->contentlets[strtolower("uuid-" . $uuid)] ?? null;
14-
10+
$contentlets = $containerRef->contentlets ?? null;
1511

1612
if ($contentlets) {
1713
foreach ($contentlets as $contentlet) {

instructions/guide.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -600,10 +600,7 @@ if (!isset($containerRef)) {
600600
global $pageAsset;
601601

602602
$identifier = $containerRef->identifier ?? null;
603-
$uuid = $containerRef->uuid ?? null;
604-
605-
// Note: dotCMS stores contentlets with a "uuid-" prefix in lowercase
606-
$contentlets = $pageAsset->containers[$identifier]->contentlets[strtolower("uuid-" . $uuid)] ?? null;
603+
$contentlets = $containerRef->contentlets ?? null
607604

608605
if ($contentlets) {
609606
foreach ($contentlets as $contentlet) {
@@ -756,8 +753,7 @@ if (!isset($containerRef)) {
756753
global $pageAsset;
757754

758755
$identifier = $containerRef->identifier ?? null;
759-
$uuid = $containerRef->uuid ?? null;
760-
$container = $pageAsset->containers[$identifier] ?? null;
756+
$contentlets = $containerRef->contentlets ?? null
761757

762758
// Container attributes for UVE
763759
$containerAttrs = [

0 commit comments

Comments
 (0)