How add something before </head>


  • Translator

    I want to...

    • add some link tags before </head> when user view register page.
    • add a <div> tag before <form> tag.and Add a <script> tag before </body> when user view register page.

    Cloud tell me which Hook i should choose? I had tried filter:meta.getLinkTags and filter:header.build ,but it didn't work


  • Admin

    add some link tags before </head> when user view register page.

    Use customJS in the acp, you can put link tags there.

    Add a <script> tag before </body> when user view register page.

    Best bet is to edit footer.tpl and add it there.


  • Translator

    @baris Can use filter:footer:build to add before </footer>?


  • Admin

    There is no filter.footer.build footer is rendered separately from the page. And those hooks are only used to add extra data to the page so templates can use them to render new stuff. Easiest is to just create a plugin and copy footer.tpl from your base theme ie persona and add your custom code there.


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.