Forum for discussing general topics related to Couch.
12 posts Page 2 of 2
There are no tags currently to deal with physical files/folders.
However, we can always fall back upon raw PHP to get the functionality that does not natively exist in Couch.

Following is a snippet that you can place in your template's <HEAD> to output the HTML required for linking JS files (make sure to specify the right path to the files first).
Code: Select all
<cms:php>
    // Path of files relative to site's root (i.e. couch's parent folder)
    $path_to_files = 'bootstrap/js/';

    // Valid extensions
    $extensions = array( 'js' );

    // Open folder and get files
    $images = array();
    if( $handle = opendir('<cms:show k_site_path />' . $path_to_files) ){
        while (false !== ($file = readdir($handle))) {
            if( $file != "." && $file != ".." ){
                $ext = strtolower( substr(strrchr($file, "."), 1) );
                if( in_array($ext, $extensions) ){
                    // output HTML
                    echo "<script src=\"<cms:show k_site_link />$path_to_files$file\" type=\"text/javascript\"></script>\r\n";
                }
            }
        }
        closedir($handle);
    }
</cms:php>

The code above should output something like -
Code: Select all
<script src="http://www.yoursite.com/bootstrap/js/bootstrap.js" type="text/javascript"></script>
<script src="http://www.yoursite.com/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>

Hope this helps.
Thanks,

That worked. Sadly the effects still do not work.

Roelof
12 posts Page 2 of 2