Nodes As Tabs

Nodes As Tabs 1.5.1

No permission to download
I have a few more questions.

- is it possible to globally disable "tab selection" mode for ALL nodes ? I'm looking for something like the option "Disable Tab Selection For Root Node" but for all nodes. I prefer to display the default links under the navbar (recent posts, followed threads, watched forums, new posts, etc) instead of links to the child forums of the current node. The reason is because i use your addon to display my forum categories as tabs, and i have too many forums to display all of them under the navbar. The forums also have long names, so only 3 of them are being displayed.
I found a workaround by removing this part in template nat_childlinks
<xen:elseif is="{$node.level} == 1" />
<li>
<xen:if is="{$nodeTypes.{$node.node_type_id}.public_route_prefix}">
<a href="{xen:link {$nodeTypes.{$node.node_type_id}.public_route_prefix}, $node}" {xen:if $node.nat_newwindow, 'target="_blank"'}>{$node.title}</a>
</xen:if>
</li>
</xen:if>
but i would prefer to display the default links (recent posts, followed, etc) instead of totally removing it


- i have set a whole category of forums as "node as a tab". Is it possible to use the full category name in breadcrumb instead of the tab title ?


- is there a way to force displaying the popup menu on hover even if the user is already browsing the forum of the current node ?


- it seems like the link is marking as read ALL forums, is it possible to mark only the current category as read ?
With nodes as a tabs, i can get a whole category of 10 forums as a tab. Notifications of unread posts are being displayed in a red bubble over it, and users are expecting the "mark as read" link inside this category's node as a tab to mark as read only the threads from this category. Not sure if this is a NaT function or XF built-in.



Sorry for asking so much questions haha
 
- is it possible to globally disable "tab selection" mode for ALL nodes ?

I would leave nat_childlinks alone. To prevent all nodetab selection edit library/NodesAsTabs/API.php. Remove or comment the red code:

Rich (BB code):
// TO BE CALLED BY POSTDISPATCH IN YOUR PUBLIC CONTROLLER
	// HANDLES TAB SELECTION
	public static function postDispatch($controller, $nodeId, $controllerResponse, $controllerName, $action)
	{
		$optionsModel = self::_getOptionsModel();

		$routeMatch = $controller->getRouteMatch();
		$request = $controller->getRequest();

		$nodeId = ($nodeId ? $nodeId : $optionsModel->getNodeIdFromRequest($request));

		if ($nodeTabId = $optionsModel->handleRoute($nodeId, $routeMatch))
		{
			// USED LATER FOR BREADCRUMBS
			$controllerResponse->containerParams['nodeTabId'] = $nodeTabId;
		}
	}

- i have set a whole category of forums as "node as a tab". Is it possible to use the full category name in breadcrumb instead of the tab title ?

Nope. The breadcrumb system in XenForo uses the tab title there.

- is there a way to force displaying the popup menu on hover even if the user is already browsing the forum of the current node ?

XenForo's nav system doesn't do that. This would require some custom development.

- it seems like the link is marking as read ALL forums, is it possible to mark only the current category as read ?

That is also a XenForo thing. That link will target the current node if it's a forum node. For all other node types it targets the entire forum. The default "mark read" link in the default Forums tab functions like this as well.
 
We have encountered this piece of code recently

PHP:
    public static function breadCrumbs($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
    {
        if ($templateName == 'PAGE_CONTAINER'
        AND $nodeTabId = $template->getParam('nodeTabId')
        )
        {
...
            // TEMPORARILY REMOVE RELEVANT LISTENERS FOR RE-RENDER
            $listeners = XenForo_CodeEvent::getEventListeners('template_post_render');
            XenForo_CodeEvent::setListeners(array('template_post_render' => false));

            $content = $template->render();

            XenForo_CodeEvent::setListeners(array('template_post_render' => $listeners));
...
        }
    }

I think there should be better way to alter the breadcrumb other than issuing a re-rendering of the PAGE_CONTAINER, on every page load? At least can you check if a re-render is required before calling render()? I think almost no one uses the advanced feature that requires this level of hackery.
 
We have encountered this piece of code recently

PHP:
    public static function breadCrumbs($templateName, &$content, array &$containerData, XenForo_Template_Abstract $template)
    {
        if ($templateName == 'PAGE_CONTAINER'
        AND $nodeTabId = $template->getParam('nodeTabId')
        )
        {
...
            // TEMPORARILY REMOVE RELEVANT LISTENERS FOR RE-RENDER
            $listeners = XenForo_CodeEvent::getEventListeners('template_post_render');
            XenForo_CodeEvent::setListeners(array('template_post_render' => false));

            $content = $template->render();

            XenForo_CodeEvent::setListeners(array('template_post_render' => $listeners));
...
        }
    }

I think there should be better way to alter the breadcrumb other than issuing a re-rendering of the PAGE_CONTAINER, on every page load? At least can you check if a re-render is required before calling render()? I think almost no one uses the advanced feature that requires this level of hackery.

https://xenforo.com/community/threads/nodebreadcrumbs-usage.27504/

If you have a better solution I would love to hear it. I hate that code.

edit - the condition at the start of that function restricts the re-render to node tabs which is exactly when it is needed.
 
https://xenforo.com/community/threads/nodebreadcrumbs-usage.27504/

If you have a better solution I would love to hear it. I hate that code.

edit - the condition at the start of that function restricts the re-render to node tabs which is exactly when it is needed.
I think it's better to make changes that alter how html is rendered via template / template modification. In this particular case, $navigation shouldn't be messed in code level (as it may trigger some unexpected behaviors).

With that in mind, I think you can make a modification to "breadcrumb" template and wrap one additional <xen:if /> inside <xen:foreach loop="$navigation" /> to remove unwanted crumbs. For link forum, I think another modification with a custom like <xen:foreach loop="$linkForumNavigation" /> should be enough.
 
I think it's better to make changes that alter how html is rendered via template / template modification. In this particular case, $navigation shouldn't be messed in code level (as it may trigger some unexpected behaviors).

With that in mind, I think you can make a modification to "breadcrumb" template and wrap one additional <xen:if /> inside <xen:foreach loop="$navigation" /> to remove unwanted crumbs. For link forum, I think another modification with a custom like <xen:foreach loop="$linkForumNavigation" /> should be enough.

Hmm. I will try that. Thanks.
 
Is there a way to add a "updated" or any other text label next to the tab title?

example:
one of my tabs is linking a node containing a table/sheet. 3-4 times a year this table is updated/changed and when this occurs I'd like to visually inform my members that the content of the tab/node has been updated.
 
Is there a way to add a "updated" or any other text label next to the tab title?

example:
one of my tabs is linking a node containing a table/sheet. 3-4 times a year this table is updated/changed and when this occurs I'd like to visually inform my members that the content of the tab/node has been updated.

You could set the Tab Title field for that node to override the title.
 
You could set the Tab Title field for that node to override the title.

@Jake Bunce I'm talking about something like the attached (edited) screenshot. The "new" labels are Photoshopped.

nodesastabsyhba3.jpg
 
Thanks for the great add on.

I am wondering if I am making a mistake. I have used it to add an external link to my blog. The URL is a bit odd though it is http://www.caminodesantiago.org.uk/link-forums/camino-adventures.38/ which then redirects to caminoadventures.com

Am I doing something wrong? I would rather have clean links.

That is normal for link-forum nodes. There is no option to change this.

You can try a template edit instead:

https://xenforo.com/community/threads/how-to-add-a-new-tab-in-the-navbar.7781/
 
@Jake Bunce I'm talking about something like the attached (edited) screenshot. The "new" labels are Photoshopped.

nodesastabsyhba3.jpg

This addon doesn't have a feature to allow arbitrary alert bubbles like that. It could be accomplished with some custom code.

CSS might be an option:

Admin CP -> Appearance -> Templates -> EXTRA.css

Rich (BB code):
.navTabs .navTab.nodetab8
{
	background-image: url("new.gif");
}

That would add the specified image as the background for nodetab8 (node_id 8 made into a tab by this addon). From there you can play with the CSS.
 
Awesome,
solved with:

Code:
.navTabs .navTab.nodetab118
{
    background-image: url("update.png");
    background-repeat: no-repeat;
    background-position: right top;
}

Thanks!
 
I have a NEW POSTS tab how can i make the unread count work for this tab to where it counts the unread posts and shows it

I assume that NEW POSTS tab is a link-forum?

What should work is to set that as the root node in your:

Admin CP -> Home -> Nodes As Tabs

That will make it so all other nodes are children of NEW POSTS for the purpose of this addon. That should make it so all other nodes are included in the unread counter for that tab.
 
Top Bottom