Filter based on first 10 digits of a field value

Not sure if this is possible, but the scenario I have is as follows:

Loop type=custompost custom_field=custom_field_1 custom_field_value="{Field other_custom_field}">

This works, however I have a scenario where the custom_field=custom_field_1 is always 10 charachters long (eg. 1234567891) but the custom_field_value="{Field other_custom_field}" is 13 charachters long (eg. 1234567891ABC)

I want to be able to filter using just the first 10 characters of custom_field_value="{Field other_custom_field}"

Is it possible that I can either trim the search value to 10 characters long or is there a function that can be used?

I think you should be able to do this with <Format length=10>, documented here.


I did look at that but it did not seem to work - also how would the format work within the query?

Loop type=custompost custom_field=custom_field_1 custom_field_value="<Format length=10>{Field other_custom_field}</format>">


All tags that are inside attribute values need to use the curly bracket format. I’m not sure what the limit is to the number/type of tags that you can use in this context, but I’ve seen people use multiple tags, replacing all angle brackets with curly brackets. So in your case I think it’d look like custom_field_value="{Format length=10}{Field other_custom_field}{/Format}"