Thanks for your question and for including the template you’ve developed; very helpful.
A few simple modifications should get you a good result. The example is missing a closing parenthesis and the arguments for substr are slightly wrong. Try something like:
template:([+file_name,substr(0,7)+] [+iptc:2#105+])
This also works in the Bulk Edit area on the Media/Assistant admin submenu, if you want to experiment on a few items before changing the IPTC/EXIF mapping rule.
As coded above, the rule will return nothing if an item is missing its [+iptc:2#105+] value. You can try something like this for a more flexible result:
template:([+file_name,substr(0,7)+]( [+iptc:2#105+]| [+iptc:2#005+]| no headline))
That should always return the first part of the file name, and add the first non-blank IPTC field it finds or the “no title” literal as a last resort. There are many variations on this basic idea.
I hope that gives you the results you need. I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above suggestions. Thanks for your interest in the plugin.
Hi David,
thank you for your quick response and for the incredible plugin you have created.
Sorry to bother you again but I’m still having some trouble with the template.
I set up a custom field named ChangeTitle so that I can try it on a single image. I used your template from above:
template:([+file_name,substr(0,7)+]( [+iptc:2#105+]| [+iptc:2#005+]| no headline))

Here are the IPTC and EXIF Field options I picked:

In the Media Library you can see that the image has a filename (Dateiname) starting with EZ00078. That is the number I would like to extract and add this to the beginning of the title (“G63 At The Speed Of Light”)

And here is the result of the custom field after mapping. Unfortunately still not the correct value:

This is where I would like the EZ00078 number to show up (FrontEnd)
Frontsite
I really appreciate you helping me with this.
Thank you and greetings from Germany
Emmanuel
Thanks for your update and all the additional information, including the link to your site (great site!).
Some small corrections should help:
- Your template looks fine, and it works on my system with your images (downloaded from your site).
- In your custom field mapping rule you must change the Data Source from “title” to “- Template (See Below) -“. Your template is currently ignored because the data source does not say to use it.
- In your IPTC/EXIF mapping rule you must change the “Priority” field from “IPTC” to “EXIF” so your template will be used instead of the IPTC Headline field.
You can test your IPTC/EXIF mapping rule on a single image by going to the Media/Assistant admin submenu and clicking the thumbnail or the “Edit” rollover action to get to the Media/Edit Media screen. You can click the “Map IPTC/EXIF metadata” link in the upper-right portion of the screen to apply the rules to the single image you are editing.
Let me know if those suggestions give you better results.
Hi David,
a huge thank you.
Works perfectly 🙂