Adding a <script> to this file:
ow_themes/simplicity/mobile/master_pages/mobile_general.html
Does nothing for me...
So in these master pages I see you can do if statements and one is for isAuthenticated
What if I wanted to check useragent...
I've already added the needed useragent and code in mdetect.php, but where is isAuthenticated() defined and initialized?
I have a new function for the useragent I want to detect in mdetect.php
What language are these .html file in that allow for if statements and where are the variables set?
If you want to dig into the code to see where stuff is initialized i would suggest you use a great tool called agent ransack, its free and it is a search utility. You can search a whole script with it to find values. Use it on var names to find what you want.
To pass a var from the php file to the html file (smarty) you just use the assign function
so in the php file you would do something like this
//initialize the php var
if(!isset($var)) { $var = ''; }
//then load the var with a value in php
$var = "somevalue";
//then pass it to smarty
$this->assign("var",$var); //format is "smartyvar", $phpvar
//then we load the value into html
//open the html file and put this
<span>{$var}</span> //wrapping it in {} indicates its a smarty var
done
hope that helps
The issue is that even with its popularity smarty like all tools is slowly becoming a thing of the past and there are scripts out there that dont use it and scripts that have used it in the past and removed it.
Its just one of those things, you love it or you hate it. It might be around for 20 more years or gone tomorrow.
{literal}
<script type="text/javascript">
"use strict";
var somevar = {/literal} '{$varname}' {literal};
</script>
{/literal}
and yes the close literal is put first, its not a typo..