Problem about global data transfer



  • I want remove breadcrumbs compoent in navbar like this
    ⬇️
    0_1504692168175_WX20170906-180233@2x.png
    All page look like this pic.
    and i code in menu.tpl inster <!-- IMPORT partials/breadcrumbs.tpl --> compoent,
    like this ⬇️
    0_1504692371523_WX20170906-180559@2x.png

    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.
    https://github.com/yariplus/nodebb-theme-persona/commit/a98e856c1de3c878d2000f3f4ddf4d1a5e9988b5

    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.


Log in to reply
 


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