I would like to be able to create custom template files to override views-slideshow-pager-fields.html.twig, views-slideshow-pager-field-item.html.twig, and views-slideshow-pager-field-field.html.twig. I've tried setting up files in my theme template directory, but they're not being recognized (as far as I can tell). Is this possible without editing the module's template files? Many thanks in advance.

Comments

renenee created an issue. See original summary.

TrevorBradley’s picture

I've hit this identical issue just now. I'm hoping the put main-section and pager-fields in a separate bootstrap regions and need to put HTML wrappers around them.

I feel like I'm close to a solution here. I can use hook_theme_suggestions_alter to add a twig suggestion:

function mytheme_theme_suggestions_views_slideshow_main_section_alter(array &$suggestions, array $variables, $hook) {
	if($variables['vss_id'] == 'product_photos-block_1') {
		$suggestions[] = $hook . '__' . "product_photos";
	}
}

The twig template suggestion is accepted, and I see it being considered in twig debug. However, it's not selected.

I'll keep plugging away at it.

TrevorBradley’s picture

Hah! That's exactly the solution. I just forgot to clear the cache after creating the twig.html file. :)

NickDickinsonWilde’s picture

Status: Active » Closed (works as designed)

yeah cache clearing is often necessary ;)