πŸ‡ΊπŸ‡ΈUnited States @rpearl

Account created on 18 January 2017, over 7 years ago
#

Recent comments

πŸ‡ΊπŸ‡ΈUnited States rpearl

Here is an example of how I was able to get this done using the theme_preprocess_views_view_field hook:

  1. In the view fields, add a "Custom Text" block where you need the breadcrumb trail to be rendered.
  2. Within this field I added some custom text advising that this field is overridden within the theme file, and also updated the Administrative title to "Custom Breadcrumb". This helps with troubleshooting or finding where this was overridden long after you forgot you did this.
  3. Add similar code below (replacing values of your own):
/**
 * Overriding the views fields.
 *
 * @param $variables
 *   An array of variables to pass to the theme template.
 *
 * @return void
 *   Nothing returned.
 */
function YOUR_THEME_NAME_preprocess_views_view_field(&$variables): void {
  if ($variables['view']->getDisplay()->display['id'] === 'YOUR_VIEW_DISPLAY_ID'
    && $variables['field']->options['id'] === 'nothing'
  ) {
    // Overriding the 'Custom Text' value to render the breadcrumb.
    $entity = $variables['row']->_entity;
    $routeName = $entity->toUrl()->getRouteName();
    $routeParameters = $entity->toUrl()->getRouteParameters();
    $route = Drupal::service('router.route_provider')->getRouteByName($routeName);
    $routeMatch = new Drupal\Core\Routing\RouteMatch($routeName, $route, $routeParameters, $routeParameters);
    $renderable = Drupal::service('breadcrumb')->build($routeMatch)->toRenderable();

    $variables['output'] = $renderable;
  }
}
πŸ‡ΊπŸ‡ΈUnited States rpearl

I created a temporary patch that trims the font_path values for local file references: trim_EOLs.patch. This allowed me to not mess with any other code and just get it working for the time being, but this module will need some refactoring on how it handles the config values and there will need to be removal of the php80 references to make this fully working and compatible with D10.

πŸ‡ΊπŸ‡ΈUnited States rpearl

Also finding issues when trying to use the Field Group module along with this. You can't group items in an accordion or tabs, they just won't work. Probably should be another ticket, but because of things like this, the resolution/patch for this current issue may need to be thought about.

πŸ‡ΊπŸ‡ΈUnited States rpearl

Has anyone used Field Group with this module to use the admin styles for grouping? I think this latest update to RC removed all of the admin styles so Field Grouping no longer works. If this needs to be considered a separate issue then we can open a new bug ticket.

πŸ‡ΊπŸ‡ΈUnited States rpearl

I agree. The only reason this issue has ever popped up on me is when Drupal could not load the CSS/JS asset file correctly. Whether it be added versioning, incorrect filenames, or file access issues. Check your logs before doing anything further.

Production build 0.69.0 2024