Skip to content

Commit 28f7d2f

Browse files
committed
FEATURE: Allow recursing through hidden documents
1 parent d39ef93 commit 28f7d2f

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

Classes/NodeEnumeration/Domain/Service/NodeContextCombinator.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ class NodeContextCombinator
3333
*/
3434
protected $contextFactory;
3535

36+
/**
37+
* @Flow\InjectConfiguration(path="nodeRendering.recurseHiddenContent", package="Flowpack.DecoupledContentStore")
38+
* @var ContextFactoryInterface
39+
*/
40+
protected $recurseHiddenContent;
41+
3642
/**
3743
* Iterate over the node with the given identifier and site in contexts for all available presets (if it exists as a variant)
3844
*
@@ -86,7 +92,8 @@ public function siteNodeInContexts(Site $site, string $workspaceName = 'live'):
8692
'currentSite' => $site,
8793
'workspaceName' => $workspaceName,
8894
'dimensions' => [],
89-
'targetDimensions' => []
95+
'targetDimensions' => [],
96+
'invisibleContentShown' => $this->recurseHiddenContent,
9097
));
9198

9299
$siteNode = $contentContext->getNode('/sites/' . $site->getNodeName());
@@ -101,7 +108,8 @@ public function siteNodeInContexts(Site $site, string $workspaceName = 'live'):
101108
'currentSite' => $site,
102109
'workspaceName' => $workspaceName,
103110
'dimensions' => $dimensions,
104-
'targetDimensions' => []
111+
'targetDimensions' => [],
112+
'invisibleContentShown' => $this->recurseHiddenContent,
105113
));
106114

107115
$siteNode = $contentContext->getNode('/sites/' . $site->getNodeName());

Classes/NodeEnumeration/NodeEnumerator.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ private function enumerateAll(?Site $site, ContentReleaseLogger $contentReleaseL
9393
foreach ($combinator->recurseDocumentChildNodes($siteNode) as $documentNode) {
9494
$contextPath = $documentNode->getContextPath();
9595

96-
if ($nodeTypeWhitelist->matches(NodeTypeName::fromString($documentNode->getNodeType()->getName()))) {
97-
96+
if ($documentNode->isHidden()) {
97+
$contentReleaseLogger->debug('Skipping node from publishing, because it is hidden', [
98+
'node' => $contextPath,
99+
]);
100+
} else if ($nodeTypeWhitelist->matches(NodeTypeName::fromString($documentNode->getNodeType()->getName()))) {
98101
$contentReleaseLogger->debug('Registering node for publishing', [
99102
'node' => $contextPath
100103
]);

Configuration/Settings.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Flowpack:
4141
# Add full HTTP message to the output of the content store
4242
addHttpMessage: false
4343

44+
# Recurse to child nodes of hidden nodes
45+
recurseHiddenContent: false
46+
4447

4548

4649
extensions:

0 commit comments

Comments
 (0)