Welcome Guest, Not a member yet? Register   Sign In
Paths for css and javascript files for modules
#1

[eluser]boony[/eluser]
Hi All,

I'm just starting out with Modules (using Matchbox) and have a quick question re pointing to the css and javascript files in the module.

My directory setting is as follows
Code:
modules/
    /my_module
        /assets
            /css
                /my_module_style.css
            /js
                /my_module_script.js
            /images
        /controllers
        /config
        /models
        /views
            /my_module_template.php

I just need to point to the my_module/assets/css/my_module_style.css in the template to load the appropriate css or javascript file.

So, what is the correct path: I've tried a couple of different combinations around..

Code:
<link rel=stylesheet ahref=<?=base_url()?>assets/css/my_module_style.css

but can't seem to find the correct way to do this.

Any help much appreciated.
#2

[eluser]ram4nd[/eluser]
put the css and js folder to your root directory
#3

[eluser]boony[/eluser]
Yeah, already done that.

But surely the whole point of modules is to have all the files required for the module available in the module. Or am I mistaken.
#4

[eluser]Phil Sturgeon[/eluser]
Take a look at my Asset library. It does exactly what you are looking for, but only works with Modular Separation. You should probably consider moving over to MS anyway as Matchbox is no longer actively maintained.




Theme © iAndrew 2016 - Forum software by © MyBB