Welcome to Geeklog Wednesday, December 19 2018 @ 04:12 am EST

Geeklog Forums

Setting a JavaScript File


How I can use a javascript file?

I try in lib-custom file

PHP Formatted Code
$_SCRIPTS->setJavaScriptFile('theme.mitheme', '/javascript/myfile.js' );

But this don't work.


Status: offline


Site Admin
Registered: 27/09/05
Posts: 1317
If it is a javascript file for your theme you can set it in the functions.php which is found in the root of the theme directory.

Look at the modern curve theme that comes with Geeklog 2.1.0 and check out the function theme_js_files_modern_curve
One of the Geeklog Core Developers.

Status: offline


Forum User
Full Member
Registered: 14/01/05
Posts: 1569
Location:la rochelle, France
Can you also try?

PHP Formatted Code
$_SCRIPTS->setJavaScriptFile('theme.mitheme', '/path_from_public_html_to/myfile.js' );

like this

PHP Formatted Code
$_SCRIPTS->setJavaScriptFile('theme.mitheme', '/layout/mitheme/javascript/myfile.js' );

I'm available to customise your themes or plugins for your Geeklog CMS


I fixed it, thanks.

PHP Formatted Code
function theme_js_files_c3()
    global $_CONF;

    return array(
            'file'      => '/layout/' . $_CONF['theme'] . '/javascript/jquery.flexslider-min.js',
            'footer'    => false, // Not requred, default = true
            'priority'  => 100 // Not requred, default = 100

All times are EST. The time is now 04:12 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content