Jake Bunce
Well-known member
In reference to this problem with my addon:
http://xenforo.com/community/threads/nodes-as-tabs-with-tab-selection.23295/page-10#post-308184
I can't modify $nodeBreadCrumbs in the controller without affecting notices and body classes. This is a request for code changes to enable me to modify the breadcrumbs without affecting anything else.
The problem I see is that $nodeBreadCrumbs is used for more than just breadcrumbs. Each content template uses $nodeBreadCrumbs to define two things:
1) The breadcrumbs (through <xen:navigation> / <xen:breadcrumb>).
2) The body classes (through <xen:container var="$bodyClasses">).
So when I modify $nodeBreadCrumbs for the purpose of removing some breadcrumbs it has the following two unintended effects:
1) It messes up inheritance of notices among nodes. By way of #1, $nodeBreadCrumbs is used by XenForo_Helper_Criteria:pageMatchesCriteria, which in that function exists as $containerData['navigation']. So removing some breadcrumbs can result in a notice not appearing in a child node when it is assigned to a parent node.
2) It removes body classes for those breadcrumbs that I have removed.
The only way I can figure to modify the breadcrumbs without affecting anything else is to re-render the breadcrumbs or container using template events which is less than ideal. Ideally I want to work with the data and not have to hack the templates.
I am open to suggestions. But for the purpose of this report I would suggest that it's inappropriate to use $nodeBreadCrumbs for anything else other than breadcrumbs. Perhaps build another param that is less intended for a specific use, like $ancestors or $nodePath.
http://xenforo.com/community/threads/nodes-as-tabs-with-tab-selection.23295/page-10#post-308184
I can't modify $nodeBreadCrumbs in the controller without affecting notices and body classes. This is a request for code changes to enable me to modify the breadcrumbs without affecting anything else.
The problem I see is that $nodeBreadCrumbs is used for more than just breadcrumbs. Each content template uses $nodeBreadCrumbs to define two things:
1) The breadcrumbs (through <xen:navigation> / <xen:breadcrumb>).
2) The body classes (through <xen:container var="$bodyClasses">).
So when I modify $nodeBreadCrumbs for the purpose of removing some breadcrumbs it has the following two unintended effects:
1) It messes up inheritance of notices among nodes. By way of #1, $nodeBreadCrumbs is used by XenForo_Helper_Criteria:pageMatchesCriteria, which in that function exists as $containerData['navigation']. So removing some breadcrumbs can result in a notice not appearing in a child node when it is assigned to a parent node.
2) It removes body classes for those breadcrumbs that I have removed.
The only way I can figure to modify the breadcrumbs without affecting anything else is to re-render the breadcrumbs or container using template events which is less than ideal. Ideally I want to work with the data and not have to hack the templates.
I am open to suggestions. But for the purpose of this report I would suggest that it's inappropriate to use $nodeBreadCrumbs for anything else other than breadcrumbs. Perhaps build another param that is less intended for a specific use, like $ancestors or $nodePath.
Upvote
5