Appending lines to meta/head text from content block
Posted: Tue Nov 11, 2014 7:24 pm
I'm looking for the canonical way to take advantage of the content block being processed ahead of the head block to let a UDT or other tag in the content block append additional styles or scripts to a page's head block at runtime.
My fallback method would be to have one or more placeholder tags templated into the head block that examine variables set by the worker tag in the content block. Obviously this isn't just for the thrill of doing it; I'd take a more static approach if it were appropriate in the larger context.
Is this fallback method in fact the best way of accomplishing that? Or what should I be exploiting something in the API to do it programmatically? I have looked at the docs and examined the particular contentObject in question, but so far I don't see a more straightforward solution.
(FWIW I notice most of the big news sites don't even bother putting such item-related data in the head block any more but inject it into the middle of the body text just before using it.)
My fallback method would be to have one or more placeholder tags templated into the head block that examine variables set by the worker tag in the content block. Obviously this isn't just for the thrill of doing it; I'd take a more static approach if it were appropriate in the larger context.
Is this fallback method in fact the best way of accomplishing that? Or what should I be exploiting something in the API to do it programmatically? I have looked at the docs and examined the particular contentObject in question, but so far I don't see a more straightforward solution.
(FWIW I notice most of the big news sites don't even bother putting such item-related data in the head block any more but inject it into the middle of the body text just before using it.)