1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Extending pageNodeNavigation

Discussion in 'Styling and Customization Questions' started by Walter, Jul 9, 2013.

  1. Walter

    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: Jul 9, 2013
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Walter likes this.
  3. Walter

    Walter Well-Known Member

    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?
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    library/XenForo/Model/Page.php

    Change to false:

    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".
     
  5. Walter

    Walter Well-Known Member

    *sigh*
    I really hate modifying the source code. The pages in Xenforo are more like a pain than a thoroughly executed feature.... :(
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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.
     

Share This Page