Problem about global data transfer

  • I want remove breadcrumbs compoent in navbar like this
    All page look like this pic.
    and i code in menu.tpl inster <!-- IMPORT partials/breadcrumbs.tpl --> compoent,
    like this ⬇

    But breadcrumbs compoent in menu not have global data about breadcrumbs,
    So I want register breadcrumb‘s data, what can i do?
    I need your help, Thanks.

  • Community Rep

    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.tpl

    Make the breadcrumbs hidden by default.

    In 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.

  • Thank you for your quick reply!

  • Thanks,
    I have solved this question by myself.



Looks like your connection to NodeBB was lost, please wait while we try to reconnect.