• Resolved Lox

    (@dreadlox)


    Hello,

    I was looking forward custom postype support but 3.6 doesn’t follow the rewrite slug I define.

    Custom post type are not always blog posts, I personnaly use custom post types as pages. I often redifine the rewrite slug and remove the front blog prefix. Example, for a school posttype I set

    Rewrite Slug: informations/schools (information and schoold are exiting pages. Doing this way a my_school school url would look like this:

    informations/schools/my_school

    But the breadcrumb shows:

    Home > Blog > my_school

    Whereas it should display:

    Home > Informations > Schools > my_school

    So here are my questions: is that behavior possible to achieve in in 3.6?

    If not, is it planned?

    Best regards

Viewing 15 replies - 16 through 30 (of 55 total)
  • Plugin Author John Havlik

    (@mtekk)

    @dreadlox:

    In the SVN Trunk there is a version that should have the fixes you need for both of your issues. Let me know if it works, or if you have suggestions for improvements. Note that this doesn’t work on archive pages yet (forgot to add it as of now, will add early this week). Do note that I may need to change the way this works to fix an issue that Dennis ran into (and that I’m about to run into myself) but that won’t come for another week or so.

    Thread Starter Lox

    (@dreadlox)

    I installed the svn version and I could remove the “Blog” element from the breadcrumb. I am currently building a music label website, so I have an “artist” post_type witch is held by an “Artists” page. So I set the rewrite slug for that post type to artists/ .

    But the breadcrumb still shows Home > Artist name instead of Home > Artists > Artist name …

    Plugin Author John Havlik

    (@mtekk)

    DeadLox,

    What type of custom post type are “artists”? If they are flat, and have a taxonomy, you’ll need to set their taxonomy, under the “Artist” tab in Breadcrumb NavXT’s settings page, to “Pages”. Then you will have to make sure every artist post has the correct page set as the parent (a real PITA and is why I do not recommend doing it this way). This is similar to the issue Dennis has, and the change in behavior I am going to work on eliminates this issue (essentially instead of turning on and off the blog breadcrumb, you will specify the “root” for the post type).

    Thread Starter Lox

    (@dreadlox)

    This is similar to the issue Dennis has, and the change in behavior I am going to work on eliminates this issue (essentially instead of turning on and off the blog breadcrumb, you will specify the “root” for the post type).

    Exactly what is needed but why don’t you do code it? Let me explain.

    Saying I have a custom post type “Computers” and a “holding page” under Products > Computers (both are pages)

    Then, I set the rewrite slug to ‘products/computers’ and front=false. So basically you could

    1. read the front parameter to decide whereas “Blog” has to be added
    2. and explode the rewrite slug using the ‘/’ parameters and do something like:

    <?php
    
    $post_for_trail = array();
    
    $post_type = get_post_type_object($post_type);
    
    $rewrite_array = explode('/', $post_type->rewrite->slug);
    
    foreach ($rewrite_array as $post_slug) {
    
    	$post_id = get_post_by_slug($post_slug); // function to be written
    
    	// one rewrite slug part is not a post we do not add anything to trail and exit
    	if( !$post = get_post($post_id) ) {
    		$post_for_trail = array();
    		break;
    	}
    
    	$post_for_trail[] = $post;
    }

    ?>

    Thread Starter Lox

    (@dreadlox)

    Any thought about my last post?

    Plugin Author John Havlik

    (@mtekk)

    Sorry for the delay, I’ve been swamped the past few days. Hopefully tomorrow I’ll get a chance to look at it/think about it.

    Plugin Author John Havlik

    (@mtekk)

    I could do it the way you suggested with your code. Though I’m not sure if it would work if there are taxonomies mixed in. Typically, I prefer to add options when they are useful, and not duplicating something that I could find from what a user specified elsewhere in their install. It looks like I may have time tomorrow to work on coding this again (as long as I don’t get another deluge of support requests again (not all related to Breadcrumb NavXT)).

    This sounds like something I could use too, I’m looking to have a flat Custom Post sitting below a Page hierarchy.

    Horrible I know, but I haven’t figured out how to use a hierarchical Custom Post and have it automatically add to the site navigation menus like Pages do.

    Plugin Author John Havlik

    (@mtekk)

    Ok guys, there is preliminary support for this in the SVN trunk. I know it has some bugs in it still (archive pages in particular). Let me know how bad it “crashes and burns” ??

    Custom Posts. Set a Root Page, Display Yes, Taxonomy to Pages.

    Custom Posts still seem to sit below the Home page..

    Changing Product Root Page has no effect. Setting Taxonomy to Post Tag or Category drops the respective breadcrumb in between Home and my Custom Post.

    What am I missing?

    Super work mtekk – you’ve made my day, it’s exactly what I needed for a project I need to finish today!

    I’ve installed the development version and it seems to be working fine.

    Thank you.

    Plugin Author John Havlik

    (@mtekk)

    Custom Posts still seem to sit below the Home page.

    Well, all pages/posts/etc are going to sit under a home/front page if you have a static front page. Note that I have not tested this in a non static frontpage setups yet as I have several kinks to work out when there are static frontpages (no ETA for this yet).

    Perhaps I could have worded that more accurately – ‘Custom Posts still seem to sit directly below the Home page.’

    Approaching from another angle – what exactly does the Root Page setting do and are there any prerequisites for its operation?

    Thanks for your time on this mtekk, really appreciated.

    Plugin Author John Havlik

    (@mtekk)

    The post type root page works like the “Page on Front” and “Posts Page” settings in WordPress. Since equivalents for custom post types do not exist (at the moment), I added this setting (for the time being).

    So, you want to set it to the “root” page for your custom post type. Breadcrumb NavXT will then build the breadcrumb trail starting with the custom post type, working backwards up to the root page for that type. Then, it will follow the root page’s hierarchy to the “Page on Front”.

    It doesn’t seem to be working for me, but I’m sure there’s something I’m missing.

    I have a non-hierarchical custom post type, with no rewrite slug set.

    I set a Root Page for this Custom Post Type of a page (which is a Page), which is at the top of the Page hierarchy.

    I set Taxonomy Display and Pages for the Custom Post Type.

    I expect to see Home > Root Page > Custom Post Type

    I only see: Home > Custom Post Type

    (This may be related but I doubt it – the tab in NavXT shows the singular label for the for the Custom Post Type?)

    So am I expecting something this doesn’t do, or am I missing a setting, or is there something wrong?

Viewing 15 replies - 16 through 30 (of 55 total)
  • The topic ‘[Plugin: Breadcrumb NavXT] Custom post type support’ is closed to new replies.