Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By soupp on
Hello
I want to implement a dirty trick for top DHTML navigation menu, which can be modified by uploading some js/html code. I'm not a programmer so I don't feel like I can wite a module for this menu manipulation which would be the right way of course.
So can I load to theme (for output to html) some code from external file? I use modified Chameleon theme.
Thanks
Comments
Edit your theme
Add a link to the <head> of your chameleon.theme file, in
function chameleon_page()
:<script src="path-to-file/file.js" type="text/javascript"></script>
I use the /misc directory to house this sort of stuff if it's to be used site-wide, else I use the theme directory. Really, you can put it anywhere your web server can see it...
/marky
Yup. Thaks.
Thanks Marky!
Quite a simple! But still: if I want to add some html (div's and so) code to page header from external file on the fly. How can I do this?