Tagged: 

Viewing 30 posts - 1 through 30 (of 36 total)
  • Author
    Posts
  • #780072

    Hi Team,

    we use many different categories for our portfolio items and have on problem with this:
    If you open an portfolio item the breadcrumb shows *all* categories were this item is in.
    It will be better to show only the item name instead all categories and the item name.
    For example: http://launch1702.allresist.de/portfolio-item/ar-300-12/

    Hope you can help? Thank you!
    Regards
    Mike

    #780762

    Hey Mike61,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look.

    Best regards,
    Victoria

    #780848

    Hi Victoria,
    sure (see Private Content), thank you for looking!

    Best regards,
    Mike

    #782834

    Hi Victoria,

    5 Days ago! I send you my answer with private data and nothing happens?

    Best Regards
    Mike

    #782890

    Hi Mike61,

    I think you should first decide what the path in breadcrumbs should look like and then we will try to find a solution for that. The theme shows the categories in which this item is, if you want something else it has to be customized. Let me know what you think.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #782896

    Hi Victoria,

    oh i decide that in my post from April 19:
    “It will be better to show only the item name instead all categories and the item name.
    For example: http://launch1702.allresist.de/portfolio-item/ar-300-12/”
    For the example it will be: Startseite / Verdünner AR 300-12

    Best Regards
    Mike

    #783985

    Hi Mike,

    Please refer to this thread for a possible solution, but it will require some coding.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #784464

    Hi Victoria,

    the example in your thread are nor more actually. There are an Custom breadcrumb generator function from Line 149 in my class-breadcrumb.php. Anyway, I found a way to fix that but one thing more is bad: I can’t use /framework/php/class-breadcrumb.php with my childtheme? That is not good for updates?! Any Idea?

    Thank you and regards
    Mike

    #785574

    Hi,

    Thank you for the info. Please add this code in the functions.php file to remove the default trail and the portfolio categories in the breadcrumb.

    add_filter('avia_breadcrumbs_trail', 'avia_change_breadcrumb', 100, 1);
    function avia_change_breadcrumb($trail) {
        if(is_singular('portfolio'))
        {
            unset($trail[1]);
        }
        return $trail;
    }
    

    Best regards,
    Ismael

    #786254

    Hi Ismael,

    I have try this but sorry, this don’t work.
    Any other Idea?

    Thank you and best regards
    Mike

    #786833

    Hi,

    I checked the breadcrumb in the portfolio page. It doesn’t display the categories anymore.

    Best regards,
    Ismael

    #786953

    Hi,
    yes Ismael bur not because you solution.
    It is still because my solution from reply #784464 and this is not
    save for updates.

    Best Regards
    Mike

    #786956

    … and it shows no categorys and this is not right because
    we need the first category (mother).

    #787539

    Hi,

    I see. If you want to display the parent category, please remove the modification then replace the filter with the following.

    function avia_change_breadcrumb($trail) {
    	if(is_singular('portfolio'))
    	{
    		global $post;
    
    		if(!empty($trail))
    		{
    			foreach($trail as $key => $data)
    			{
    				if($key != 0 || $key != 'trail_end') {
    					unset($trail[$key]);
    				}
    			}
    		}
    
    		$home = avia_get_option('frontpage');
    		$terms  = get_the_terms( $post->ID, 'portfolio_entries' );
    		$gterms = get_terms( array( 'taxonomy' => 'portfolio_entries', 'parent' => 0, 'hierarchical' => true) );
    		$exlude = array();
    		$text = "";
    
    		if(!empty($gterms))
    		{
    			foreach($gterms as $key => $data)
    			{
    				$exclude[] = $data->term_id;
    			}
    		}
    
    		if(!empty($terms))
    		{
    			$home = $trail[0];
    			$counter = 1;
    			$last = array_pop($trail);
    			foreach($terms as $key => $data)
    			{
    				if(in_array($data->term_id, $exclude)) {
    					$link = '<a href="'.get_term_link($data).'">'.ucfirst($data->name).'</a>';
    					$link = preg_replace('!rel=".+?"|rel=\'.+?\'|!',"", $link);
    					$link = str_replace('<a ', '<a rel="v:url" property="v:title" ', $link);
    					$text = '<span typeof="v:Breadcrumb">'.$link.'</span>';
    					$trail[$counter] = $text;
    					$counter++;
    				}
    			}
    			$trail[0] = $home;
    			$trail['trail_end'] = $last;
    		}
    	}
    	return $trail;
    }

    Best regards,
    Ismael

    #787688

    Hi Ismael,

    thank you for you great support but this solution shows only this breadcrumb:
    “Sie befinden sich hier: Startseite / Verdünner AR 300-12”. For this item is the
    catgory “Verdünner” primary and has to be shown like this:
    Startseite / Verdünner / Verdünner AR 300-12
    Hope we will find an solution…

    Best regards
    Mike

    primary

    #788319

    Hey!

    The filter above should display every parent category. Unfortunately, you cannot filter the “primary” terms or portfolio category. We modified the code a bit. Please try it again. Or post the FTP details here so that we can test it.

    Cheers!
    Ismael

    #788348

    Hi Ismael,
    I am glad that you will test it – Thank you!
    Send you my private content…

    Best Regards
    Mike

    #788778

    Hi,

    yes Ismael bur not because you solution.
    It is still because my solution from reply #784464 and this is not

    Where can I find that solution? What file? Could you please remove it temporarily so that we can test the filter?

    Best regards,
    Ismael

    #789066

    Hi,

    Where can I find that solution?

    whtat is that? You find *your* solution at reply #785574!
    I *had* remove all modifications and send you private content, what you need further??????

    Best Regards
    Mike

    #789493

    Hi,

    Please review your response here:

    // https://kriesi.at/support/topic/breadcrum-shows-all-categories-off-an-portfolio-item/#post-786953

    The categories are not displaying in the breadcrumb so the modification or solution that you mentioned is still in effect. Please remove that modification so that we can test the filter properly.

    And please note that we can’t locate the reply based on the reply number “#784464” or “#785574”. You need to include the actual post url plus the number. Example:

    // https://kriesi.at/support/topic/breadcrum-shows-all-categories-off-an-portfolio-item/#post-786953

    Best regards,
    Ismael

    #789545

    Hi Ismael,

    Please remove that modification so that we can test the filter properly.

    Sorry I know, but there is no more modification?!

    “whtat is that? You find *your* solution at reply #785574!” = https://kriesi.at/support/topic/breadcrum-shows-all-categories-off-an-portfolio-item/#post-785574

    Hope you can help, best regrads
    Mike

    #789990

    Hey!

    I’m really sorry for the confusion but what do you mean by the following statement?

    It is still because my solution from #784464

    What is the solution or modification that you added to the theme? Please remove that modification, otherwise the filter that we added won’t work. That modification is still in effect because the default breadcrumb trail is still not displaying in the portfolio page.

    // https://kriesi.at/support/topic/breadcrum-shows-all-categories-off-an-portfolio-item/#post-784464

    Best regards,
    Ismael

    #791064

    What is the solution or modification that you added to the theme?

    I added nothing, I comment out in /enfold/framework/php/class-breadcrumb.php line 313 /*if($parent_item) $trail[] = $parent_item;*/ …

    Please remove that modification, otherwise the filter that we added won’t work.

    … and remove my comments after you tell me that I have to do that and overwrite class-breadcrumb.php with an orignial file from the zip archive – save is save ;). Than I put your filter from https://kriesi.at/support/topic/breadcrum-shows-all-categories-off-an-portfolio-item/#post-784464 to functions.php an have still the same problem with the looooog trail (that what I wrote here https://kriesi.at/support/topic/breadcrum-shows-all-categories-off-an-portfolio-item/#post-786953). After this I remove your first filter with your filter from post https://kriesi.at/support/topic/breadcrum-shows-all-categories-off-an-portfolio-item/#post-787539 – nothing change!
    Take a look: http://launch1702.allresist.de/portfolio-item/verduenner-ar-300-12/

    But when I use that code:

    add_action('after_setup_theme','avia_remove_portfolio_breadcrumb');
    function avia_remove_portfolio_breadcrumb(){
    	remove_filter('avia_breadcrumbs_trail','avia_modify_breadcrumb');
    	add_filter('avia_breadcrumbs_trail', 'avia_change_breadcrumb', 100, 1);
    }

    I got the short trail without primary categorie. I have comment out this code.
    At this time only your second solution is online!

    So, hope you understand what I wrote and you have any idea!

    Best reagrds
    Mike

    • This reply was modified 7 years, 6 months ago by Mike61.
    #791623

    Hi,

    Thank you for the info.

    Unfortunately, it’s not possible to get the “Primary” category only. The category has to be a parent category. In the product “verduenner-ar-300-12”, there is no parent category so we can’t distinguished which category to retrieve. We can set the filter to display a single category but it’s not going to be the “Primary” category.

    Best regards,
    Ismael

    #791629

    Hi Ismael,

    ok, is there an solution for using parent category?

    Bets regards
    Mike

    #792012

    Hi,

    We implemented a filter that will return the first category.

    Best regards,
    Ismael

    #792117

    Hi Ismael,

    first I have to say thank you for this, your great support and that you stay in touch for this long time! Your filter works but the result is wrong because the sequence of tags is alphabetical and can’t be set by the user?! So is the first tag not the tag what the user will see in the breadcrumb :( Unfortunly I don’t know a way to set the first tag manually?!

    For you understandig what the user of this site do: The primary tag is the productgroup of this product and the other tags are products and knowlege posts around this product. He need an breadcrumb like this: Home/productgroup/product

    Best Regrads
    Mike

    • This reply was modified 7 years, 6 months ago by Mike61.
    #792454

    Hi,

    I’m sorry but what do you mean by tag and product group? The problem with this is that there is no parent category setup for the product. All of them, the categories, are first level categories. They don’t have child categories so it’s not possible to distinguish which is the main category.

    Best regards,
    Ismael

    #793221

    Hi Ismael,

    this is not right, there are parent categorys, have you ever take a look?
    Here for the old example…
    http://launch1702.allresist.de/portfolio-item/ar-300-12/

    Parent category = “Produktzuordnung”
    cat

    and here the wrong breadcrumb…
    https://www.exusu-design.de/_data/catresult.png

    but it have to be “Startseite / Produktzuordnung/ Verdünner AR 300-12” when your descrition are right.

    do you mean by tag and product group?

    Sorry, what I mean is not tag, I mean category. The Parent category is the product group for example.

    Best regards
    Mike

    #794596

    Hi,

    Please check the actual portfolio item. It is not assigned to any parent category. (see private field)

    Best regards,
    Ismael

Viewing 30 posts - 1 through 30 (of 36 total)
  • The topic ‘Breadcrum shows *all* Categories off an Portfolio Item’ is closed to new replies.