[MGNLDEMO-19] Use createAreaNode=false for navigation and make it operate on page instead of area node Created: 05/May/15  Updated: 20/May/15  Resolved: 20/May/15

Status: Closed
Project: Magnolia Demo Projects
Component/s: magnolia-travels
Affects Version/s: 0.5
Fix Version/s: 0.5

Type: Bug Priority: Major
Reporter: Philip Mundt Assignee: Philip Mundt
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
is depended upon by MGNLDEMO-43 Remove navigation from sportstation w... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Comments   
Comment by Christian Ringele [ 06/May/15 ]

Here the commit I did for showing this:
https://git.magnolia-cms.com/gitweb/?p=user/cringele/training-demo-project.git;a=commit;h=72996a6c9409d7a968e03973893917520d3193ea

It still has code i would simplify, I just left it in that its clear what was before and after wards:

In NavigationAreaModel.java:
-            Node currentPage = NodeUtil.getNearestAncestorOfType(content, NodeTypes.Page.NAME);
+            // Content is now the page node, as the area node is not created anymore.
+            // currentPage = NodeUtil.getNearestAncestorOfType(content, NodeTypes.Page.NAME);
+            Node currentPage = content;
             int depth = currentPage.getDepth();

to proper code:

// So simple it becomes
int depth = content.getDepth();
Generated at Mon Feb 12 05:15:29 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.