How can I implement a condition in a kiosk mode template?

How can I implement a condition in a kiosk mode template?

How can I implement a condition in a kiosk mode template?

For example:

if %model%"=="BQ

   <li><A href ="<MCLink7>"><img src="<MCExeIcon7>" onerror="this.style.display='none'" /><div class="txt"><MCDISP7></div></a></li>

else

   <li><A href ="<MCLink8>"><img src="<MCExeIcon8>" onerror="this.style.display='none'" /><div class="txt"><MCDISP8></div></a></li>

endif

 

Sorry, I don't know the html language

6 Answers

Order By:   Standard | Newest | Votes
DDMOD@SOTI | posted this 08 June 2020

Hi GMFOOD,

 

Thanks for the post!

Please follow the below SOTI help document to customize the KIOSK mode template as per your requirement:

https://www.soti.net/mc/help/v14.1/en/console/configurations/profiles/configurations/categories/restrictions/lockdown_templates.html?

 

Regards,

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |

  • 1
  • 0
Raymond Chan | posted this 09 June 2020

To use conditional statement like what you have in your post,  you need to include javascript codes to dynamically manuipulate some of your html/CSS codes.

If the condition is actually related to screen resolutions rather than device brand/model, you might use screen related constructs in CSS.

Both approach needs programming skills (html/CSS/javascript), and it is not practical to discuss details with such limited space in this forum or post any template that would work without needing some customizations for your actual use.

 

One simple approach you can use without any programming needed is to put your lockdown menu in a separate profile, duplicate it into two or more profiles that are specific to particular device brand/model, configure the kiosk item settings accordingly for each such profile, and then deploy/assign such brand/model specific profiles with profile filter option(s) based on device brand/model parameter(s).

 

  • 1
  • 0
GMFOOD | posted this 09 June 2020

Thanks for Info. I think this answer is the right solution.

But I think it should be easier. That is, from a variable, which is interpreted by the kiosk mode -html template-, to be able to assign one option or another. Keep investigating

  • 0
  • 0
GMFOOD | posted this 09 June 2020

I don't mean to abuse your help, but I would want you to see what I mean.

--- CODE ---

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bloqueo Android GM Food</title>
<style type="text/css">

html, body { height: 99.3%; }

body {
margin: 4px 4px 0px 4px;
background: #FFF;
}

....

</div>

<div id="Main">
<div class="row">
<ul>
<!-- To display the image for the item rather than use the EXE icon use this line instead
<li><A href ="<MCLink0>"><img src="<MCDispImg0>" /><div class="txt"><MCDISP0></div></a></li>-->

<li><A href ="<MCLink0>"><img src="<MCExeIcon0>" onerror="this.style.display='none'" /><div class="txt"><MCDISP0></div></a></li>
<li><A href ="<MCLink1>"><img src="<MCDispImg1>" onerror="this.style.display='none'" /><div class="txt"><MCDISP1></div></a></li>
<li><A href ="<MCLink2>"><img src="<MCExeIcon2>" onerror="this.style.display='none'" /><div class="txt"><MCDISP2></div></a></li>
<li><A href ="<MCLink3>"><img src="<MCDispImg3>" onerror="this.style.display='none'" /><div class="txt"><MCDISP3></div></a></li>
</ul>
</div>

<div class="row">
<ul>

<li><A href ="<MCLink4>"><img src="<MCExeIcon4>" onerror="this.style.display='none'" /><div class="txt"><MCDISP4></div></a></li>
<li><A href ="<MCLink5>"><img src="<MCExeIcon5>" onerror="this.style.display='none'" /><div class="txt"><MCDISP5></div></a></li>

<li><A href ="<MCLink6>"><img src="<MCExeIcon6>" onerror="this.style.display='none'" /><div class="txt"><MCDISP6></div></a></li>

<li><A href ="<MCLink7>"><img src="<MCExeIcon7>" onerror="this.style.display='none'" /><div class="txt"><MCDISP7></div></a></li>

</ul>
</div>
<div class="row">
<ul>

<hr color="green" size=8/>

<li><A href ="<MCLink14>"><img src="<MCDispImg14>" onerror="this.style.display='none'" /><div class="txt"><MCDISP14></div></a></li>

<li><A href ="<MCLink8>"><img src="<MCExeIcon8>" onerror="this.style.display='none'" /><div class="txt"><MCDISP8></div></a></li>

<li><A href ="<MCLink9>"><img src="<MCExeIcon9>" onerror="this.style.display='none'" /><div class="txt"><MCDISP9></div></a></li>

<li><A href ="<MCLink10>"><img src="<MCExeIcon10>" onerror="this.style.display='none'" /><div class="txt"><MCDISP10></div></a></li>


</ul>
</div>

<div class="row">
<ul>

<hr color="red" size=8/>

<li><A href ="<MCLink12>"><img src="<MCDispImg12>" onerror="this.style.display='none'" /><div class="txt"><MCDISP12></div></a></li>

<li><A href ="<MCLink11>"><img src="<MCExeIcon11>" onerror="this.style.display='none'" /><div class="txt"><MCDISP11></div></a></li>

 

--- MY CONDITION (IF) %MODEL%==BQ

<li><A href ="<MCLink13>"><img src="<MCDispImg13>" onerror="this.style.display='none'" /><div class="txt"><MCDISP13></div></a></li>

-- ELSE

<li><A href ="<MCLink14>"><img src="<MCDispImg14>" onerror="this.style.display='none'" /><div class="txt"><MCDISP14></div></a></li>

--- END CONDITION

 

</ul>
</div>
<div class="row">
<ul>
</ul>

</div>
</div>
<div class="push"></div>
</div>
<div id="id" style="display:table-cell; vertical-align:bottom; text-align:center">%devicename%

</div>
</body>
</html>

---//---

You would not want to have multiple profiles created in Soti, depending on the tablet model. And so I could solve the situation

I hope that by example, what I intend will be better understood.

Anyway, I think your answer is the one I will use.

Thanks

 

  • 0
  • 0
Raymond Chan | posted this 09 June 2020

I of course understand what you meant without seeing you html codes.

 

Unfortunately, html is a markup language and there is no support for conditional statement construct.  As said in my earlier post, you need to include javascript in your html template file to support conditional program flow such that one single html+CSS+javascript file can support dynamic layout for devices of different models.  

 

As said earlier, if you do not have the programming skill to do the above, the simplest is to have two html files that differ by one or two lines, one for BQ devices and the other for non-BQ devices.  Then, just use two profiles that are applied with different profile filter option to achieve what you want.  The whole thing can likely be done in less than 5 minutes, which is likely shorter than the time you need to put your follow-up posts on this forum.

 

  • 1
  • 0
GMFOOD | posted this 09 June 2020

THANKS VERY MUCH

So I did this morning! ;)

 

  • 0
  • 0

Give us your feedback
Give us your feedback
Feedback