mtekk's Crib
November 30th, 2007

Ok, so no bugs were reported for Beta 1, but I did find a problem with the way the breadcrumb was build for pages. Beta 2 fixes that and not much else. I need feedback and translators. There is now a SVN repository for Breadcrumb NavXT, its over at wp-plugins.org. This version also has a slightly different file structure, the main folder for Breadcrumb NavXT is now breadcrumb-navxt instead of breadcrumb-navigation-xt-2. The change corresponds to the assigned directory in wp-plugins.org.

[download=7]

-John Havlik

[end of transmission, stay tuned]

Tagged:

53 Responses to “Breadcrumb NavXT 2.0 Beta 2”

  • Patrick

    Thanks for continuing work on this plugin, I was looking around for a solution to wordpress’s lack of breadcrumbs and this one really takes the cake.

    The only thing that caused confusion for me was the initial setup with there being two plugins present in the plugin area of WP. As the Core class file also has plugin headers. Was this done for a reason?

  • The core has it’s own plug-in headers since the administration interface is not required to generate the breadcrumb. I explained that in the beta 1 post, but forgot to in this one. You most likely want to just want to use the administration interface one. The core one is there for theme designers and maintainers who don’t need the administrative interface (or others who use the advanced method of displaying the breadcrumb).

    -John Havlik

  • I was previously using the old version of the plugin by Michael Woehrer.

    The only reason I upraded was because I would like it to support the core tagging functionality of WordPress 2.3.

    Everything works great except that the breadcrumb now misses off the category of a post (on a single page). With the old version this worked as I expected, i.e.

    Home > Category > Post Title

    Is there a configuration flag I have overlooked?

  • Hello Daniel,

    What is the plug-in outputting now instead of Home > Category > Post Title (e.g. an example of an output for a single post page)? If I know what it is doing it will help me fix the problem. ;)

    Also ensure that the setting “Single Blog Post Category Display” is set to true (should be the default value).

    -John Havlik

  • All I am getting is:

    Home > Post Title

    The post belongs to only one category.

    $mybreadcrumb->opt['singleblogpost_category_display'] = true

  • Daniel,

    What you need to do is use quotes around true. The plug-in now does string comparison instead of boolean comparison for all formerly boolean variables as getting a boolean value in and out of the database for the administrative interface caused some issues. Just a note, this has been the behavior since 1.9.3. Try that and let me know if it works now.

    -John Havlik

  • Spot on. Thanks for the help.

    Keep up the good work, this plugin does the job fantastically!

  • alainS

    Nice to see that someone took over the developement of breadcrumb navxt.
    I have to tell you that everything is working fine with the second beta! (php 4.4, apache 1.33, mysql 4.1 and WP 2.31)

    Just a note to users upgrading from 1.xx versions. You have to change the class you’re calling from “breadcrumb_nav_xt_display” to “bcn_breadcrumb” in your template. I was pissed off until I’ve found that this changed :)

    Keep on the good work!

  • Alan S,

    It’s good to hear that things still work on php4. I don’t have any means of testing on php4 platforms and there were some outstanding bugs in the 1.xx series for php4. As for the renaming of the class, I did mention it in the post for beta 1, but didn’t mention it in this post as most people are using the admin interface now. Now if some people could test it’s functionality with static front pages, then I can fix any bugs in that and release beta 3 or RC1 depending on the amount of response that I get from testers.

    -John Havlik

  • snoogly

    Can’t activate the Core plugin.

    Fatal error: Cannot redeclare class bcn_breadcrumb

    Any idea why this might be happening?

  • @snoogly

    The plugin comes with two versions.

    You have enabled both the normal plugin and the administration version. You may only have one enabled at a time.

  • Snoogly,
    What Daniel said is correct, only enable the core plug-in if you will be using the advanced usage methods and not the administrative interface. If you want the administrative interface, only enable that administrative interface part of the plug-in it will do all the necessary including for you.

    -John Havlik

  • Hi, sorry to repeat myself, but I think my problems seem more relevant on this page. I am logged in as Admin and have deactivated/deleted all the old instances of the breadcrumb plug in, but I still get an error saying:

    Fatal error: Cannot redeclare bcn_get() (previously declared… (etc.)

    Are there some other files I must delete for wordpress to allow me to install the new version?

  • David,

    I was going to respond sooner but my internet went down this morning. Anyways, I’m pretty sure the problem is caused by you having the Breadcrumb NavXT – Core plug-in activated at the same time as the Breadcrumb NavXT – Admin plug-in. Deactivate the Core plug-in and then try to activate the Admin plug-in. If this does not work please try deactivating all plug-ins. Then activate Breadcrumb NavXT – Admin, and then activate, one by one, each of the plug-ins you wish to use, if the error appears again in this process, let me know when it began.

    By the way, WordPress should be auto deactivating plug-ins that cause php to throw errors.

    -John Havlik

  • Hi John, FYI, I had to change the display function to add an html_entities_decode(), to allow me to correctly add and display HTML in the separator parameter.

  • I deactivated all of my plug ins and tried activating only the admin plug-in but it still gave me the same error:-(

    Fatal error: Cannot redeclare bcn_get() (previously declared… (etc.)

    I even tried renaming all instances of bcn_get() to bcn_get2() but it said the problem now lies with bcn_get2. Something is definitely very wrong. So desperate to get my portfolio finished, but cant move forward till i get that final part of my breadcrumb working.

    Interestingly, the core plug-in seems to activate fine. Maybe I could just use this, what code could i use to get the same effects that I was getting for the old version of the breadcrumb with the admin interface?

  • Shri,
    I’ll look into that for RC1, some things were removed in the rewriting of everything.

    David,
    That’s interesting. So when you have all plug-ins deactivated and attempt to activate the admin plug-in it doesn’t work, but you can enable the core plug-in. By chance, where did you download the plug-in? I’m going to have to check the SVN to make sure nothing became corrupted or something. For using the Core plug-in, settings will be similar to the way things are done for the “advanced usage” of Breadcrumb Navigation XT. As this is a beta I have not had the time to update the documentation, but most of the things are the same between what’s up there and what Beta 2 supports for options. The default options will give you something like what is present on my blog here.

    -John Havlik

  • I downloaded it from the link at the top of the page

  • David,
    How long ago did you download it? One thing that you could try is open up the file breadcrumb_navigation_xt_class.php and remove the following:
    //Load up the language file
    //include(dirname(__FILE__)."/languages/EN_en.php");
    //Load up WordPress API supplement
    //include(dirname(__FILE__)."/breadcrumb_navigation_xt_API.php");

    Then try and see if the administrative plug-in loads properly. That should have been commented out, but if it isn’t it may cause problems. Also if that doesn’t work look for references to the file breadcrumb_navigation_xt_api.php in the class file, if there are remove them. The administration file should only have one reference to the api file.

    -John Havlik

  • Hi,

    That didn’t work:-( Still get the error. Could wordpress have saved some of the plugin into memory somehow? Is there a way of clearing that memory?

  • David,
    I can’t think of a caching scheme that would do that, but it may be possible. Clearing that memory would require restarting your Apache process (or what ever http server you are using). You’re running 2.3.2, correct? Could you try commenting out the line that includes breadcrumb_navigation_xt_api.php in breadcrumb_navigation_xt_admin.php, it’s on something like line 25. See if that works, if it does it would be php/apache caching functions, which is odd. If you get functions not found errors you can try copying the functions from the api file to the admin file, just keep them near the top.

    -John Havlik

  • Tried sending this message a few times, but does not seem to work? Hopefully this time.

    Hi,

    I really appreciate this help by the way:-)

    I tried commenting out the line and the error changed to this:

    Fatal error: Cannot redeclare class bcn_breadcrumb in /public_html/quirksmode/wp-content/plugins/breadcrumb-navxt/breadcrumb_navigation_xt_class.php on line 27

    Do you want my log in details to take a closer look, can email them to you?

  • David,

    It looks like Spam Karma kept gobbling up your posts due to time outs or something. There is seriously something weird with your server. I swear the problem you are seeing should only be seen if you are trying to have the core and administration plug-ins active at the same time. You could try renaming the class file temporarily, see if that will let things work. Or try commenting out line 27 in the administration file, the line should contain an include function. If you want you can e-mail me, or IM (my Jabber/G-mail one is the one that works right now).

    -John Havlik

  • I have the same problem:

    Fatal error: Cannot redeclare class bcn_breadcrumb in C:\AppServ\www\wp232\wp-content\plugins\breadcrumb-navxt\breadcrumb_navigation_xt_class.php on line 27

    $bcn_version = “2.0.0″;
    //Load up the language file
    //include(dirname(__FILE__).”/languages/EN_en.php”);
    //Load up WordPress API supplement
    //include(dirname(__FILE__).”/breadcrumb_navigation_xt_API.php”);
    //The main class
    class bcn_breadcrumb
    {

  • To solve my problem of it installing, I had to switch to the advanced version (core). The following code then got the breadcrumb working:

    opt['title_blog'] = ‘Home’;
    $mybreadcrumb->opt['separator'] = ‘ » ‘;
    $mybreadcrumb->opt['singleblogpost_category_display'] = true;
    // Display the breadcrumb
    $mybreadcrumb->display();
    } ?>

  • The code seems to have been cut in half, will try that again:

    opt['title_blog'] = ‘Home’;
    $mybreadcrumb->opt['separator'] = ‘ » ‘;
    $mybreadcrumb->opt['singleblogpost_category_display'] = true;
    // Display the breadcrumb
    $mybreadcrumb->display();
    } ?>

  • third times the charm;-)


    opt['title_blog'] = 'Home';
    $mybreadcrumb->opt['separator'] = ' » ';
    $mybreadcrumb->opt['singleblogpost_category_display'] = true;
    // Display the breadcrumb
    $mybreadcrumb->display();
    } ?>

  • Jesse,

    By chance are you running PHP4 with safe-mode? I’m curious to figure out what is causing the problem that both David and you have experienced. You can try the advanced method as David did, it looks like the code he posted worked.

    David,

    Did you get the categories to show up? It looks like you did, I just want to make sure that you did figure out the settings. Also do you want your first two posts with the code deleted as they look about the same?

    Just a heads up for everyone, for the time being I no longer have internet access at home due to remodeling that we are doing. Thus, I will only be able to respond to things between 9am and 5pm CST, Monday through Friday.

    -John Havlik

  • Unfortunately I didn’t manage to get the categories to work when I clicked the individual portfolio link. I stuck in some temporary custom code to “hack” it. It’s not ideal, just a temporary cludge till i work out what the problem is. Here is the cludge code I used (hope it displays properly):


    Home » Portfolio » <a href="http://www.dj-djp.co.uk/quirksmode/portfolio/" title="Browse to: "> »

    Do you have any ideas how I could get it working without having to use the above?

  • the code didn’t show properly, but basically its using category title calls to pull in the missing links.

  • Hello mtekk,

    I guess this pertains to Shri’s comment above. I’d like to use an image as a separator but adding an tag doesn’t seem to do anything? Am I doing this wrong or do I need to modify the code somehow?

    Thanks,
    Tyler

  • Tyler,

    You must have the option “Preserve spaces at the end and beginning of the options”, if not checked these spaces will not be saved.” selected for html code to be passed through. The span tag does work, and I do not recommend using images for breadcrumb separators as it is bad from a usability standpoint. Images have never been, and most likely will never be officially supported in the basic usage (its mainly due to technical problems with what WordPress likes to do with wpdb->sanitize()), you will have to use the core plug-in and call the class manually which allows for much greater flexibility and will let you do almost anything you want. You’ll want to take a look at the project page on this blog located at http://mtekk.weblogs.us/code/breadcrumb-nav-xt and go to the advanced usage section and read up on that, just note that that information is a tad out of date, and some things have changed but if you take a quick peek at the code in the class.php file it should help you figure out which settings you’ll need to set.

    -John Havlik

  • David,

    Just a heads up, you have the text “ANC[1]: 3
    ANC[0]: 6″ showing up on it, I’m not sure what that is but looks like it may be a bug with a different plug-in. Anyways, is it just failing to output the categories, or only showing one or something? Keep in mind that categories are meant to be hierarchical, so if you have a post in multiple non-hierarchical categories, the first will be the only one displayed. Also make sure the option “singleblogpost_category_display” is set to true for categories to be displayed.

    -John Havlik

  • I may look into this more but for now I’ve decided not to use an image as a separator. I’d prefer to stick to the basic usage anyhow, so I’m pretty sure I’ll survive without images. Thanks for your help, John. And thanks yet again for continuing work on this indispensable plugin.

    Tyler

  • Having real trouble posting, it’s prob my pc:-P will try again.

    Hi,

    That code is for the fold_page_list plug in. I was using the ancestor id function to try and work out why it wasn’t working for the individual portfolio page. The code it’s displaying is for debug purposes.

    Interestingly the navigation stops working at exactly the same place the breadcrumb does.

    The breadcrumb is failing to output the categories. It displays the pages fine e.g. Home > Portfolio > Websites
    But when you click on a portfolio item (which is in fact a post, which belongs to a catergory e.g. Portfolio > Websites) it does not display the full path even though the url displays perfectly.

    it displays like this:

    Home > Hunters Hill

    When it should display like this:

    Home > Portfolio > Websites > Huntershill

    I have set the singleblogpost_category_display to true.

  • David,

    Just post things once, I’m getting them, it just Spam Karma 2 ends up running during a server reset and doesn’t pass your comment through moderation. One thing to note about the boolean settings in Breadcrumb NavXT is that they must be entered as strings, thus true should be entered as ‘true’ or “true” and likewise for false, otherwise results will be unpredictable. How are you implementing your pages/posts? It may have something to do with the observed behavior. Also, would it make more sense in this case to just use pages?

    Debugging wise, Breadcrumb NavXT contains allot of the WordPress API is_ (is_page(), is_category(), etc.) conditionals, you can add echo statements within them to figure out the path or execution which will aid in finding the root of the problem. Naturally, you may want to remove your hackish code that makes the breadcrumb look correctly right now so it doesn’t interfere with your debugging.

    -John Havlik

  • Adding the quotes fixed it so it now displays properly. Only problem now is that the urls are linking to (for example):

    http://www.dj-djp.co.uk/quirksmode/category/portfolio/websites/

    When i want:

    http://www.dj-djp.co.uk/quirksmode/portfolio/websites/

    I think it’s because my individual portfolio items are set up as posts and not pages.

    I know its a little off topic, but if I were to set up individual pages instead of posts, would I be able to display them in the same way as I have set up now.

    E.g. for the potfolio/websites page I display all the posts related to the websites category with image, abbreviated content and title link that leads to the full post? Can I acheive the same thing with pages?

  • David,
    I suspect you are using the loop in that portfolio page to list out the post/pages in the category, correct? Without writing a custom plug-in there is no automatic way to do this in an automated way with pages. The links that Breadcrumb NavXT are the “true” links to the page, which as the it is a post will fall under the /category/ bin. You could play around with your permalinks to hide this, though I’d warn it may break things (it at least used to break WordPress somewhat).

    -John Havlik

  • Hi,

    Yeah, that’s how I had it set up. I think I may have cracked it though. I have created sub pages to have the same name as the posts (which means the permalinks work because it automatically loads the page over the post) and used a template for those pages that calls the single post of the same name to the page. This means I can still store my information as posts, but also maintain a decent page structure.

    Will try to implement it properly tonight, but at first glance I may have cracked it. Will let you know:-)

  • It works perfectly now!! happy days. Thanks so much:-)

  • Dave Ainsburg

    Hi, thanks for supporting this plugin! Just a quick question if you have time.

    Is there a way to output just the text of the breadcrumb trail, without the comment and HTML links?

    I found that this plugin solved a page titling problem for me which WordPress tags could not, but there’s one problem remaining that would be completely fixed if I could get the output to be “clean” text.

    Thanks for any help!

  • Dave,

    Right now the support is not exactly there for disabling all of the links. However if you feel up to modifying the source, there should be non-linking equivalent for the functions used to get the links as part of the WordPress API, check out http://codex.wordpress.org/Function_Reference for the available functions.

    -John Havlik

  • Dave Ainsburg

    Well, I’m not a WordPress or PHP programmer, so no, no hacking source code for me :) I tried putting the breadcrumbs call in a function with strip_tags, but that didn’t work at all, and that’s more programming than I want to get into anyways.

    Thanks for your reply!
    Dave

  • Dave,

    One thing you may want to try is if your are going to wrap the display function with the strip_tags function, what you should do is use the advanced method of calling the breadcrumb. And then instead of using the vanila display() function, pass the function the boolean true as it display(true). This will return the output instead of echoing, then the strip-tags should work, and then you just have to echo that output.

    -John Havlik

  • This works with the latest:

    Put into your header:

    display();
    }
    ?>

  • oops…

    if (class_exists(‘bcn_breadcrumb’))
    {
    // New breadcrumb object
    $mybreadcrumb = new bcn_breadcrumb;
    // Display the breadcrumb
    $mybreadcrumb->display();
    }

  • Phil,

    That would still output the links, I think, which would be invalid HTML. Using display(true); and running that output through strip-tags and then echoing the output of strip-tags should produce the desired effect while outputting valid code.

    -John Havlik

  • Hi,

    I experience the same error message as Snoogly when I try to activate BNXT Admin plugin “Cannot redeclare class…”

    So I activated the core version. But I don’t know what to do now ? Breadcrumb doesn’t appear and I don’t find the documentation for implementing this plugin.

    I saw it may be possible to edit the class code (“‘url_blog’ => ”,//” etc…) but when done, which tag do I need to add to the templates ?

    Can you please help ?

    Thanks in advance,

    Gautier.

  • Gautier,

    Please follow the advise suggested to Snoogly. Only the Core or the Admin plug-in can be activated. If the Admin plug-in by itself fails with the same problem, then you are experiencing a similar problem to David. If you are going to use the advanced method (call the class manually) you should follow the advanced usage guide, and use the documentation for Breadcrumb Navigation XT to supplement the current shortcomings in the documentation of Breadcrumb NavXT.
    -John Havlik

  • John,

    Thanks a lot for your kind and fast reply. I read again comments and yes, in fact my problem is the same as David.

    I will use your link to install the core version, thank you!

    Gautier.

Leave a Reply

You may use these (x)HTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>