New answers tagged

2

Doh! It was my ternary logic that was failing not the regex. I’m now doing this: {% set vidUrl = block.videoUrl %} {% if 'youtu' in vidUrl %} {# Check for an 'embed' URL which may need cleaning #} {% set vidId = 'embed' in vidUrl ? vidUrl|replace('/^http.*embed\\/([^\\?]+)(\\?.*)?$/', '$1') : null %} {# Check for a 'watch' URL which may need ...


1

Have you checked that the custom fields are searchable by having the "Use this field’s values as search keywords" option checked? The value will be added to the index only after this is checked and the entry is saved. You can also rebuild the search index with a console command. php craft resave/entries --update-search-index I'd also recommend ...


Top 50 recent answers are included