How to show all nodes in a page node?

ismael33

Member
I need to show all nodes in a page node. Then i will link all entries to create new thread in that forum.

Which is the best way to do this preserving permissions?
 

Brogan

XenForo moderator
Staff member
Node Tree -> Node -> Page Options -> List Sibling Nodes/List Child Nodes

Oh wait, you want to create URL's to all forums on a single page?
You will just have to create the HTML code and add it to the page.

You can try wrapping specific URLs in user group conditionals, to show/hide each one to specific groups.

Or, if you're proficient with PHP, you can do a PHP callback.
 

ismael33

Member
That's not exactly i need. I need to show all nodes, not only List Sibling Nodes. Something like forum's list in 'fast navigation link' but chanching their destination link.
 

Brogan

XenForo moderator
Staff member
You can try copying the code for the quick navigation menu and amend it to add a post thread link.
 
R

ragtek

Guest
You can get all Forums with this code snippet
PHP:
    public static function getAllNodesByType($type = 'Forum', $ignoreNestedSetOrdering = false, $listView = false)
    {
        /** @var $nodeModel XenForo_Model_Node */
        $nodeModel = self::getNodeModel();

        $nodes = $nodeModel->getAllNodes($ignoreNestedSetOrdering, $listView);
        foreach ($nodes AS $node) {
            if ($node['node_type_id'] != $type) {
                unset($nodes[$node['node_id']]);
            }
        }

        return $nodes;
    }
 

ismael33

Member
In wich class are 'getAllNodesByType' function. Have i to put it in 'PHP Callback' option in the page node?
 

ismael33

Member
ok. So the steps are:

1. create a new class with a static method
2. create a template
3. do a php callback

where have i to create the new class and how xenforo knows where is it?
 
F

Floris

Guest
Custom things like a php callback are .. custom, so they require you to build your add-on within the library, in a custom dir, with a custom file. Perhaps you will have more add-ons, etc. So I recommend to people to use a unique personalized but recognizable main directory - for my site i put all my plugins under library/ in the xenfans/ directory. Since this is in relation to pages php callback, I would just make up a dir called pages/ and inside it your index.php (can also be callbackstuff.php. So you get:

library/ismael/pages/index.php

index.php starts with:

<?php
class ismael_pages_index
{
// your code here
}

the class is build on the dir it's un, from underneath the library/ directory, the php file is appended without the .php
I've coloured them so you can see what I mean. library/dir/dir/dir/file.php ends as dir_dir_dir_file

Within the class you can put your function with a return.
 
Top