Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Example for having a stylesheet from the customization assets folder loaded:

Code Block
languagephp
class ConfigboxControllerExample extends KenedoController {
  ...
  /**
  * @return string[] Array of full URLs to the stylesheets you need loaded
  */
  function getStyleSheetUrls() {
	$urls = parent::getStyleSheetUrls();
	$urls[] = KenedoPlatform::p()->getUrlCustomizationAssets().'/css/custom_stylesheet.css';
	return $urls;
  }
  ...  
}

Notes:

  • Always return the parent function's URLs along with your URLs

  • No need to worry about duplications (e.g. in case of multiple views rendered). The framework filters out duplicates.

  • If you use minified CSS, put the original and minified version on the site and return the non-minified version of the stylesheet. The framework will look for a .min.css file and use it instead.

  • See about cache invalidation for these stylesheets.

  • Use KenedoPlatform::p()->getUrlCustomizationAssets() to get the URL to the customization assets folder.

  • In case a separate stylesheet is overkill for your use-case, use the custom.css stylesheet instead.

...