Problem about global data transfer
-
I want remove
breadcrumbs
compoent in navbar like this
️
All page look like this pic.
and i code inmenu.tpl
inster<!-- IMPORT partials/breadcrumbs.tpl -->
compoent,
like this ️
But
breadcrumbs
compoent inmenu
not have global data aboutbreadcrumbs
,
So I want register breadcrumb‘s data, what can i do?
I need your help, Thanks. -
Will have to use some custom JS and the ajaxify hooks to move the breadcrumbs.
Leave the
<!-- IMPORT partials/breadcrumbs.tpl -->
in the pages, and add it to the header.tplMake the breadcrumbs hidden by default.
https://github.com/yariplus/nodebb-theme-persona/commit/a98e856c1de3c878d2000f3f4ddf4d1a5e9988b5In the custom JS settings in the admin panel, move the breadcrumb from the content section to the header. Then show the breadcrumbs. This should make it look like the breadcrumbs are loading with the rest of the page.
$(window).on('action:ajaxify.end', function(event, data) { var $breadcrumb = $('#content ol.breadcrumb'); // Select the breadcrumbs $('#header-menu ol.breadcrumb').replaceWith($breadcrumb); // Copy them to the header $('#header-menu ol.breadcrumb').show(150); // Show them }); $(window).on('action:ajaxify.start', function(event, data) { $('#header-menu ol.breadcrumb').hide(150); // Hide breadcrumb when the page is changing. });