View more context

 

KP

Whats the best way to pull in files, e.g:

  1. // 3.x Way
  2. Requirements::javascript(SSViewer::get_theme_folder() . '/javascript/testing.js');
  3.  
  4. // 4.x - One way of doing it
  5. Requirements::javascript('themes/mint-base/javascript/testing.js');

However if the theme name changes this will break? Is there a nicer way of handling this in 4.x?

null

@KP there's a "themedJS" now. In SS4 you can no longer assume there's a single theme, since they cascade

KP

@null - Cool yeah I saw that and have used, what about in these situation where using javascriptTemplate:

  1. $vars = [
  2. "MemberID" => Security::getCurrentUser()->ID,
  3. ];
  4.  
  5. Requirements::javascriptTemplate("<my-module-dir>/javascript/some_file.js", $vars);

Looks like you would still have to hard code in the actual theme location?

null

not sure of the exact syntax, but it's something like mint-base:javascript/some_file.js if coming from a theme or subtheme

mmativ

Hi Guys, after combining the css files i got 403 error

mmativ

i got this settings.

Files: Requires logging in with Slack to view/download
Untitled
nightjarnz

but first check it's not your settings via web server configuration if you're doing something that might be considered 'not default' (or have edited the .htaccess file for example).