Breadcrumbs/menu for dynamic pages Im breaking my head around getting the breadcrumbs set properly on views page. 

my views' page address is "teachers/%" where % is a term-id.

I have a content type called 'program' with a field taxonomy term reference field "field_department"

I want to set my breadcrumb for the page  'teachers/%' to be the breadcrumbs of the program associated with % + the program itself.

my site is using also menu_breadcrumb which gives the rule for my program breadcrumbs.

I want the the breadcrumb of 'teachers/7' will behave as if it is the menu child of node/22.

I tried both hook altering the breadcrumbs or adding the pages to the menu dynamically but I dont manage.

Can this be done? and how?
Views breadcrumbs can be tricky. You can create a module and a class that implements BreadcrumbBuilderInterface and do:

class MyBreadcrumbBuilder implements BreadcrumbBuilderInterface {

  use StringTranslationTrait;

  /**
   * The AdminContext service.
   *
   * @var \Drupal\Core\Routing\AdminContext
   */
  protected $adminContext;

  /**
   * The AliasManager service.
   *
   * @var \Drupal\Core\Path\AliasManagerInterface
   */
  protected $aliasManager;

  /**
   * The EntityTypeManager service.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * {@inheritdoc}
   */
  public function __construct(
    AdminContext $admin_context,
    AliasManagerInterface $alias_manager,
    EntityTypeManagerInterface $entity_type_manager
  ) {
    $this-&gt;adminContext = $admin_context;
    $this-&gt;aliasManager = $alias_manager;
    $this-&gt;entityTypeManager = $entity_type_manager;
  }

  /**
   * {@inheritdoc}
   */
  public function applies(RouteMatchInterface $route_match) : bool {
    if ($this-&gt;adminContext-&gt;isAdminRoute()) {
      return FALSE;
    }

    // Using route_match, check if the current route is a view and which view id
    // and return true or false
  }

  /**
   * {@inheritdoc}
   */
  public function build(RouteMatchInterface $route_match) : Breadcrumb {
    $breadcrumb = new Breadcrumb();

    // create your breadcrumbs...

    return $breadcrumb;
  }

}