Formatting a custom template for a File Window Layout with approximate date

Started by BanjoTom, March 27, 2025, 07:49:25 PM

Previous topic - Next topic

BanjoTom

I handle approximate dates in two basic ways.  If I know a file date only to the year — 1965, for example — I  may enter "1/1/1965" into the tag for CreateDate:   {File.MD.createdate}   

But sometimes I also use the tag called "Coverage": {File.MD.XMP::dc\coverage\Coverage\0} to enter a bit of text like "c. 1965" or, if I guess the season or month, I may enter "spring, 1965" or "c. May, 1965" or "early 1940s" into that Coverage tag.

I'm now trying to set up a File Window layout that will show the "Coverage" tag if anything is entered there, but will otherwise use the "CreateDate" tag, which is always there. 

I've tried the following in the layout as a custom template:

{File.MD.createdate|default:{File.MD.createdate|format:MMM. D, YYYY};hasvalue:File.MD.XMP::dc\coverage\Coverage\0}}

and that template does show the "coverage" tag when that exists, but it doesn't ever show the CreateDate when there is nothing in the "coverage" tag showing an entry for an approximated date.  

Help! Where am I going wrong with the variable formatting?  
— Tom, in Lexington, Kentucky, USA

PandDLong


I do the exact same as you, although I use a different tag for the approx. date info, the idea is the same. My variable expression is slightly different, using your tag names, it would be:

{File.MD.XMP::dc\coverage\Coverage\0|default:{File.MD.createdate|format:MMM. D, YYYY}}

Note that I didn't put this in VarToy to test so the syntax may be slightly off, but you get the idea of what I am trying to do.

I hope that is helpful.

Michael


BanjoTom

— Tom, in Lexington, Kentucky, USA