Probably going to be an easy win for someone here, but being able to do this is currently eluding me. So:
I'm trying to output a list of Artist names grouped by first letter but need to ignore 'The ' when it appears at the start of an Artist name.
To do this, I've added a 'Sort Title' field to the Artist entry (as I figured there might be other occasions where this could be useful) - and using Brad's answer here this works fine when outputting a standard alphabetical list.
However, there's also a page that needs to display the Artists grouped by first letter. Code for that currently is:
{% for letter, artists in craft.entries.section('lineup').order('title') | group('title|upper|slice(0, 1)') %}
How best could I adapt that to use my sortTitle field (when it isn't empty) to group the Artist entries? I get 'Expected name or number' if I try to use Brad's code in place of 'title'.