My point is that binary files will never use an HTML wrapper or anything else associated with a template, so output shouldn’t fail; output should just ignore the assigned template altogether. Doesn’t that make sense? It’s bizarre to me that [[*content]] is needed in a template assigned to a binary static resource, because as far as I can tell, I can fill up a template with all sorts of code, and none of it affects the output of a binary file at all. So why does “[[*content]]” have to be in there? It just makes no sense logically.
AND, if the static resource is not binary, say a text file, and resource type is text, and I assign a custom template that is completely blank (doesn’t have [[*content]]) in it, that works just fine. Why does a non-binary static resource not need [[*content]], but a binary one does??? Even a static resource of type HTML outputs the linked file when assigned a completely blank template.
Also, the MODX Docs on static resources says this:
If you need to add some meta information to the resource via some Template Variables, and you create your own ‘empty’ template to enable this, then you must set the contents of the template to [[*content]]
before it will work correctly.
If “[[*content]]” is the only text in the custom template, how would TVs have any effect on it?
And note that it doesn’t say anything about binary files not loading at all if “[[*content]]” isn’t in your template, only that you need this if you’re using TVs for something.
If there is actually no way to change how this works, or some reason this has to stay the way it is (please tell me why!), then it would be good to update the MODX Docs to specify that [[*content]] is needed in any template, using TVs or not, for binary static resources.
Yes, as I mentioned above, I have to set up a specific template in order to use form customization to remove fields unrelated to how the binary static resource works, like long_title and description for example.
I wouldn’t have gotten into this dilemma if I hadn’t wanted to use form customization for my binary static resources, and if my regular template didn’t have a non-cached content field. I often want different layouts for different resources, even ones that use the exact same template code, so it’s a little funky that we have to create new templates just to be able to add custom layouts. It sure would be nice to be able to have layouts that aren’t tied to just one specific template. But that’s a whole other can of worms … !
And, FYI, I’m not just “complaining”. I’m:
-
Trying to understand better how MODX works at the programming level.
-
Suggesting improvements that I think would make for better user experience, greater efficiency, and/or less hair-pulling.