XF 1.2 Extending pageNodeNavigation

Walter

Well-known member
I currently test a forum with a page "home" and using "pages/home/" as Index Page Route. The reason is to fake a mini CMS on this site. Works perfectly with XF 1.2. The pageNodeNavigation currently looks like this:

Code:
Index (=my page "home")
--page 1
--page 2
--page 3
My Forum Index

Now I have to achieve two last things:

1) How can I show the pageNodeNavigation also in the forum itself? Not only on the pages? This way I would have a consistent navigation throughout the whole site.

2) How can I add the top level forums to the pageNodeNavigation? Should look like this:

Code:
Index (=my page "home")
--page 1
--page 2
--page 3
My Forum Index
--top level forum 1
--top level forum 2
--top level forum 3
 
Last edited:
Thanks @Jake Bunce

Another question: the problem with the navigation via the pageNodeNavigation is:
I only get the navigation if I check "Display in the node list" on the pages, but then I also get them in the forum, something I don't want because it looks ugly to have dozens of pages showing up in the forum. Can I change the template to not show the article node?
 
Thanks @Jake Bunce

Another question: the problem with the navigation via the pageNodeNavigation is:
I only get the navigation if I check "Display in the node list" on the pages, but then I also get them in the forum, something I don't want because it looks ugly to have dozens of pages showing up in the forum. Can I change the template to not show the article node?

library/XenForo/Model/Page.php

Change to false:

Rich (BB code):
	public function getChildNodes(array $page)
	{
		$nodes = $this->_getNodeModel()->getChildNodesToDepth($page, 1, true);

		return $this->_prepareRelatedNodes($nodes);
	}

Then it will ignore "display in node list".
 
*sigh*
I really hate modifying the source code. The pages in Xenforo are more like a pain than a thoroughly executed feature.... :(

The modification can be made into an addon if you are a programmer. An addon is actually the best way. I just posted instructions for the file edit to be as accessible and as instructive as possible without actually coding up an addon.
 
Back
Top Bottom