Ordering of javascript includes in $head tag
Hi folks -- I'm currently coding a public theme that makes use of the nifty corners technique to generate image free curved corners. However, I've run into a *critical* problem. When I hardcode the additional javascript inserts that are required into the html head, all possible variations of ordering the $style, $head, and the hardcoded include fail to work. The only way I've been able to get around this as of now is by removing the head and style tags, and pasting this hardcoded mess (includes in questions are on line 4,5): <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <base href="http://www.telecommunity.us/tispa/" /> <style type="text/css" media="all">@import "misc/drupal.css";</style><style type="text/css" media="all">@import "modules/dashboard/dashboard.css";</style> <script type="text/javascript" src="themes/curved_slate/nifty.js"></script> <script type="text/javascript" src="themes/curved_slate/layout.js"></script> <script type="text/javascript" src="misc/drupal.js"></script> <script type="text/javascript" src="modules/event/event.js"></script><style type="text/css" media="all">@import "modules/graphstat/graphstat.css";</style> <script type="text/javascript" src="misc/textarea.js"></script> <script type="text/javascript" src="misc/collapse.js"></script> <link rel="shortcut icon" href="misc/favicon.ico" type="image/x-icon" /> <style type="text/css" media="all">@import "themes/curved_slate/style.css";</style> <style type="text/css" media="all">@import "modules/event/event.css";</style> The two javascript includes apparently need to come before misc/drupal.js for the nifty corners technique to work. Any ideas on a cleaner way to include the javascript in the right order without breaking module's ability to extend the template? Best, Nick Lewis http://nicklewis.smartcampaigns.com
On 1/26/06, Nick Lewis <nick@smartcampaigns.com> wrote:
The two javascript includes apparently need to come before misc/drupal.js for the nifty corners technique to work. Any ideas on a cleaner way to include the javascript in the right order without breaking module's ability to extend the template?
I'm probably missing something but why don't use just put the following in your theme: <head> <title><?php print $head_title ?></title> <script type="text/javascript" src="themes/curved_slate/nifty.js"></script> <script type="text/javascript" src="themes/curved_slate/layout.js"></script> <?php print $head ?> <?php print $styles ?> </head> Cheers, Chris
Chris Cook wrote:
On 1/26/06, Nick Lewis <nick@smartcampaigns.com> wrote:
The two javascript includes apparently need to come before misc/drupal.js for the nifty corners technique to work. Any ideas on a cleaner way to include the javascript in the right order without breaking module's ability to extend the template?
I'm probably missing something but why don't use just put the following in your theme:
<head> <title><?php print $head_title ?></title> <script type="text/javascript" src="themes/curved_slate/nifty.js"></script> <script type="text/javascript" src="themes/curved_slate/layout.js"></script> <?php print $head ?> <?php print $styles ?> </head>
The issue is ordering -- the javascript inclusions don't work when placed in front of the drupal.js include. After talking with Ber, I'm beginning to think that using javascript to generate curves around certain div elements might be a good support module. That way, other themes could make use of the javascript. Who knows though... a big factor for me right now is 3 deadlines that are coming up which want "curvy" templates. Best, Nick Lewis http://nicklewis.smartcampaigns.com
Cheers, Chris
participants (2)
-
Chris Cook -
Nick Lewis