You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See this reddit post. The ability to combine two multi-value templates into a new list of values would be useful inside the template language.
New syntax:
`"pretext{delim+template_field:subfield(field_arg)|filter[find,replace] conditional&combine_value?bool_value,default}posttext"
&combine_value: Template fields may be combined with another template statement to return multiple values. The combine_value is another template statement. For example, the template {created.year&{folder_album,}} would resolve to ["1999", "Vacation"] if the photo was created in 1999 and was in the album Vacation. Because the combine_value is a template statement, multiple templates may be combined together by nesting the combine operator: {template1&{template2&{template3,},},}. In this example, a null default value is used to prevent the default value from being combined if any of the nested templates does not resolve to a value
Another use case for variables is filtering combined template values. For example, using the &combine_value mechanism to combine two template values that might result in duplicate values, you could do the following: {var:myvar,{template1&{template2,},}}{%myvar|uniq} which allows the use of the uniq filter against the combined template values.
The text was updated successfully, but these errors were encountered:
See this reddit post. The ability to combine two multi-value templates into a new list of values would be useful inside the template language.
New syntax:
`"pretext{delim+template_field:subfield(field_arg)|filter[find,replace] conditional&combine_value?bool_value,default}posttext"
&combine_value
: Template fields may be combined with another template statement to return multiple values. Thecombine_value
is another template statement. For example, the template{created.year&{folder_album,}}
would resolve to ["1999", "Vacation"] if the photo was created in 1999 and was in the albumVacation
. Because thecombine_value
is a template statement, multiple templates may be combined together by nesting the combine operator:{template1&{template2&{template3,},},}
. In this example, a null default value is used to prevent the default value from being combined if any of the nested templates does not resolve to a valueAnother use case for variables is filtering combined template values. For example, using the
&combine_value
mechanism to combine two template values that might result in duplicate values, you could do the following:{var:myvar,{template1&{template2,},}}{%myvar|uniq}
which allows the use of theuniq
filter against the combined template values.The text was updated successfully, but these errors were encountered: