well the title is pretty much on point. id like to add the necessary source to a javascript for my custom tag only if the tag is used on a page. i have looked through the forums only finding solutions for teamplates. can somebody help out here? thank you!
In this post I proposed a method that gets all tags and then filters out the link tag. If you change the regex pattern, you can limit this methods to find your custom tag only and instead of returning a list, you would just return true or false.
If your page contains multiple sections with content from different pages, this gets more complicated, though.
If the pages contains a collection of subpages, then you can makes this a pages method and loop through each page in the pages collection. Or even better, a pages method that filters the collection by the custom page method.