Based on the file path, I would like Templater to add a file tag. In pseudocode inSdlc = filePath includes “SDLC” add “sdlc” to file tags
I suspect I might need to use tp frontmatter to get the desired results, but my experiments there didn’t go any better.
Forgot to paste the code I was using: <%* await if(tp.file.path(1).includes("Coverage Areas/SDLC")) tp.file.tags.push("sldc") _%>
<%* await
if(tp.file.path(1).includes("Coverage Areas/SDLC")) tp.file.tags.push("sldc")
_%>
Have you tried the Folder templates in Templater? You’d need a template for each folder, which isn’t as elegant as just having a line of code, I guess, but you could have templates for each folder, and then the only difference would be the tag.
Folder templates