Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
head-hook
Could something like inject_head($contents)
be added to the core? The function would insert content before </head>
. Normally plugins have to buffer and str_replace, but it’s tedious.
$contents = <<<EOD
<script type="text/javascript">
function jmdDoStuff(){}
</script>
<style type="text/css">
#jmd_plugin
{}
</style>
EOD;
inject_head($contents);
Offline
Re: head-hook
If it was there, I’d use it.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: head-hook
What must be in head and cannot be inserted in body?
Would this be a generic hook for all admin pages or aimed at specific events / steps?
Offline
Re: head-hook
Inserted CSS (either style or link elements). It works in the body, but I’d prefer not to invalidate TXP’s HTML.
Edit: It’d be great if it was like register_callback(), so it could be loaded on certain events and steps.
Last edited by jm (2008-06-13 09:59:12)
Offline
Pages: 1