Skip to content

How can an extension put some code just before the closing body tag? #876

Discussion options

You must be logged in to vote

Example 1 - Extension loads JavaScript in the footer:

    public function onParsePageExtra($page, $name) {
        $output = null;
        if ($name=="header") {     // <---- CSS is added to the top of a page
            $extensionLocation = $this->yellow->system->get("coreServerBase").$this->yellow->system->get("coreExtensionLocation");
            $output = "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"{$extensionLocation}helloworld.css\" />\n";
        }
        if ($name=="footer") {      // <---- JavaScript is added to the bottom of a page
            $extensionLocation = $this->yellow->system->get("coreServerBase").$this->yellow->system->get("coreExtensionLocation…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
4 replies
@bpgs
Comment options

@GiovanniSalmeri
Comment options

@bpgs
Comment options

@markseuffert
Comment options

Comment options

You must be logged in to vote
1 reply
@bpgs
Comment options

Answer selected by bpgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants