[geeklog-modules] Javascript Functions

geeklog-modules-admin at lists.geeklog.net geeklog-modules-admin at lists.geeklog.net
Fri Jun 27 14:16:35 EDT 2003


I ran into the very same problem quite awhile ago and didn't want
to load all javascripts and style sheets on every single page.
Plus, I had some pages I didn't want indexed by robots.  I fixed
the COM_siteHeader routine which you pointed out here on mine,
but decided back then it was not flexible enough to meet my need.

So, I created a new global $_CONF variable, a new template
variable, and a metatag table.  Then I wrote a small routine,
called in lib-common.php, to do a table lookup for the respective
page and substitute my new template variable in header.thtml with
the javascript, style sheet, and metatags for that page.

Is this the best way?  Don't know...maybe, maybe not, but at
least it allows me to get around Geeklog's inability to handle
dynamic headers.   I can keep my pages light and not load
unnecessary code/style sheets on each one.


----- Original Message -----
From: <geeklog-modules-admin at lists.geeklog.net>
To: <geeklog-devel at lists.geeklog.net>
Cc: <geeklog-modules at lists.geeklog.net>
Sent: Thursday, June 26, 2003 10:16 PM
Subject: [geeklog-modules] Javascript Functions


What would be the recommended way to include Javascript functions
in
plugins?

1) Have users add the function to the template header.thtml file
?
2) Output it before calling COM_siteHeader - messes up the Tags
and HTML
3) Echo out a <head> then the JS script and </head> - Messes up
the HTML as
well

Whats the easiest and best way to support this ?
- I suggest we come up with a way to extend COM_siteHeader so
that it can be
passed the name of a JS script to include as it's building the
header page

BTW:
While looking at COM_siteHeader, I saw that there is the feature
to replace
the complete header with your own function. Neat - has anyone
seen this
implemented - maybe not because I believe it's broken.

There is a problem is with this code - it's checking for a
non-existing
$_CONF variable
    $function = $_CONF['layout'] . '_siteHeader';


_______________________________________________
geeklog-modules mailing list
geeklog-modules at lists.geeklog.net
http://lists.geeklog.net/listinfo/geeklog-modules




More information about the geeklog-modules mailing list