Silverstripe Version:
4.5 Question:
I am trying to implement JSSOR slider into a system,
it uses a code like this for initialization:
The problem is, that all $Bla variables are parsed and deleted by SS template parser - is there any trick to prevent this?
Kind of odd for that plugin to want variables in that format but nothing you can do about that!
If there’s a way to do this out of the box I don’t know what it is. All I can think of (untested) is to use TemplateGlobalProvider to add a method that would be available to all templates that just takes in and returns a string. Something like
public static function NoParse($string)
{
return DBField::create_field('HTMLText', $string);
}
Then in your template you could do $NoParse('$Duration').
(Its only used in article-details)
$this->jssorScript = file_get_contents(PageController::ThemePath() . “/php-templates/jssor_script.php”);
(so I can edit the script via a backend editor)
And in the template just:
$jssorScript.RAW
before the slider html