Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-07-30 05:52:09

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

callback_event body_end query

Question du jour … in txplib_html is the following:

function end_page()
{
    global $event, $app_mode, $theme, $textarray_script;

    if ($app_mode != 'async' && $event != 'tag') {
        callback_event('admin_side', 'main_content_end');
        echo n.'</main><!-- /txp-body -->'.n.'<footer class="txp-footer">';
        echo pluggable_ui('admin_side', 'footer', $theme->footer());
        callback_event('admin_side', 'body_end');
        echo script_js('vendors/PrismJS/prism/prism.js', TEXTPATTERN_SCRIPT_URL).
            script_js('textpattern.textarray = '.json_encode($textarray_script, TEXTPATTERN_JSON), true).
            n.'</footer><!-- /txp-footer -->'.n.'</body>'.n.'</html>';
    }
}

The callback event for ‘main_content_end’ comes just before </main> but the callback event for ‘body_end’ is in the <footer>...</footer>.

Just out of curiosity, any reason it’s not placed just before </body> (as its name implies)?

Offline

#2 2020-07-30 08:08:23

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,468
Website GitHub

Re: callback_event body_end query

Because our callback naming scheme has traditionally been… whimsical at best. On my todo list is a way of migrating callbacks to a more determinant dotted notation, like we’ve begun with the themes (Skin) package.


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

#3 2020-07-30 08:15:51

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: callback_event body_end query

I’ve been wondering for yonks why sometimes my debug output wrecks the footer … today I found out why!

Offline

Board footer

Powered by FluxBB