• If there are no breadcrumbs to be displayed the plugin echos the following:

    \breadcrumb-navxt\class.bcn_breadcrumb_trail.php
    Line: 1179-1181

    
    //Helps track issues, please don't remove it
    $credits = "<!-- Breadcrumb NavXT " . $this::version . " -->\n";
    echo $credits . $trail_str;
    

    And here’s the problem, there’s an \n at the end of the version info outputted and therefore it’s impossible to use the pseudo class :empty on the parent element.

    It’s because "<!-- Breadcrumb NavXT 5.7.1 -->\n" is not equal with empty, because of the new line, therefore the :empty class doesn’t take effect.

    Please remove the \n.

    See:
    https://developer.mozilla.org/en-US/docs/Web/CSS/:empty

    • This topic was modified 7 years, 5 months ago by fireemerald.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Havlik

    (@mtekk)

    The only time that Breadcrumb NavXT would generate an empty trail is if you have disabled the display of the Home/Blog/Mainsite breadcrumbs and are using extra code to remove the current item from the trail. Regardless, for the next version (6.0.0), I can add a check for if the trail string is empty before printing anything.

    Thread Starter fireemerald

    (@fireemerald)

    Breadcrumb NavXT generates an empty trail if you have disabled the display of the Home/Blog/Mainsite breadcrumbs and you visit the Mainsite. Result: "<!-- Breadcrumb NavXT 5.7.1 -->\n" – without any extra code.

    • This reply was modified 7 years, 5 months ago by fireemerald.
    Plugin Author John Havlik

    (@mtekk)

    Sorry, yes, I forgot about that case. Typically you’d wrap the call in an if statement that checked for that (and other conditions when you don’t what the trail to be displayed) and prevent bcn_display() from being called. That way you don’t end up with extra markup at all (since you’ll have a div for wrapping the entire breadcrumb trail and setting up the schema.org BreadcrumbList declaration).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove unnecessary new line’ is closed to new replies.