Tagged: ismael
-
AuthorPosts
-
April 19, 2017 at 5:42 pm #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
MikeApril 20, 2017 at 8:51 pm #780762Hey 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,
VictoriaApril 20, 2017 at 10:30 pm #780848Hi Victoria,
sure (see Private Content), thank you for looking!Best regards,
MikeApril 25, 2017 at 12:51 pm #782834Hi Victoria,
5 Days ago! I send you my answer with private data and nothing happens?
Best Regards
MikeApril 25, 2017 at 2:26 pm #782890Hi 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,
VictoriaApril 25, 2017 at 2:32 pm #782896Hi 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-12Best Regards
MikeApril 27, 2017 at 12:56 pm #783985Hi 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,
VictoriaApril 28, 2017 at 12:04 pm #784464Hi 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
MikeMay 1, 2017 at 8:08 am #785574Hi,
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,
IsmaelMay 2, 2017 at 10:04 am #786254Hi Ismael,
I have try this but sorry, this don’t work.
Any other Idea?Thank you and best regards
MikeMay 3, 2017 at 2:42 am #786833Hi,
I checked the breadcrumb in the portfolio page. It doesn’t display the categories anymore.
Best regards,
IsmaelMay 3, 2017 at 7:43 am #786953Hi,
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
MikeMay 3, 2017 at 7:45 am #786956… and it shows no categorys and this is not right because
we need the first category (mother).May 4, 2017 at 4:21 am #787539Hi,
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,
IsmaelMay 4, 2017 at 10:37 am #787688Hi 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
MikeMay 5, 2017 at 11:29 am #788319Hey!
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!
IsmaelMay 5, 2017 at 12:27 pm #788348Hi Ismael,
I am glad that you will test it – Thank you!
Send you my private content…Best Regards
MikeMay 6, 2017 at 11:58 am #788778Hi,
yes Ismael bur not because you solution.
It is still because my solution from reply #784464 and this is notWhere can I find that solution? What file? Could you please remove it temporarily so that we can test the filter?
Best regards,
IsmaelMay 7, 2017 at 9:20 am #789066Hi,
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
MikeMay 8, 2017 at 12:30 pm #789493Hi,
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,
IsmaelMay 8, 2017 at 1:22 pm #789545Hi 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
MikeMay 9, 2017 at 6:14 am #789990Hey!
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,
IsmaelMay 10, 2017 at 1:31 pm #791064What 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.
May 11, 2017 at 1:27 pm #791623Hi,
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,
IsmaelMay 11, 2017 at 1:42 pm #791629Hi Ismael,
ok, is there an solution for using parent category?
Bets regards
MikeMay 12, 2017 at 4:07 am #792012Hi,
We implemented a filter that will return the first category.
Best regards,
IsmaelMay 12, 2017 at 7:47 am #792117Hi 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.
May 12, 2017 at 6:58 pm #792454Hi,
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,
IsmaelMay 15, 2017 at 9:20 am #793221Hi 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”
and here the wrong breadcrumb…
https://www.exusu-design.de/_data/catresult.pngbut 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
MikeMay 17, 2017 at 4:52 am #794596 -
AuthorPosts
- The topic ‘Breadcrum shows *all* Categories off an Portfolio Item’ is closed to new replies.