- Issue created by @codebymikey
- Merge request !106Issue #3538743 by codebymikey: Child ordering route renders nested books as a flat list → (Closed) created by codebymikey
- Merge request !107Issue #3538743 by codebymikey: Child ordering route renders nested books as a flat list → (Merged) created by codebymikey
The child books will always have at least a single indentation, but didn't want to complicate the logic a bit more than necessary to remove it, but feel free to tweak accordingly if the flat behaviour is desired.
- 🇺🇸United States smustgrave
Tried to get started on the tests but seems this causes it to fail
$supported_depth = $route_name === 'book.node_child_ordering' ? max($depth, 2) : 2;
-
smustgrave →
committed 45a06fba on 3.0.x authored by
codebymikey →
Issue #3538743 by codebymikey: Child ordering route renders nested books...
-
smustgrave →
committed 45a06fba on 3.0.x authored by
codebymikey →
-
smustgrave →
committed b5c7f6be on 2.0.x
Issue #3538743 by codebymikey: Child ordering route renders nested books...
-
smustgrave →
committed b5c7f6be on 2.0.x
The following change on 2.0.x and 3.0.x causes the books to be rendered as a flat list on both of the Child order and Book routes.
- $supported_depth = $route_name === 'book.node_child_ordering' ? max($depth, 2) : 2; + $supported_depth = $route_name === 'book.node_child_ordering' ? max($depth, 9) : 9; if (isset($data['link']['depth']) && $data['link']['depth'] > $supported_depth) { $indentation = [
This is because the
$data['link']['depth'] > $supported_depth
condition below it is never true.On further investigation, the route checking logic isn't necessary, and the snippet could simply be replaced with:
- $supported_depth = $route_name === 'book.node_child_ordering' ? max($depth, 9) : 9; + $supported_depth = max($depth + 1, 2); if (isset($data['link']['depth']) && $data['link']['depth'] > $supported_depth) {
And the indentation should work properly on all routes, unless the book outline route strongly needs to keep the indentation consistent with the top level book.