HTMS
  • Start
  • Main
    • Installation
    • Config
    • HTMS Files
  • Functions / Events
    • SLoad Event
    • Update Function
    • RemoveCache Function
  • Concepts
    • Static Vars
    • Shared vars [Dev]
  • Commands
    • Import
    • Inject
    • Replace
    • Module
    • Exp [Dev]
  • Tutorials
    • Start using HTMS
    • Using modules
Powered by GitBook
On this page
  • Syntax
  • Updating vars
  1. Concepts

Static Vars

Added in V1

PreviousRemoveCache FunctionNextShared vars [Dev]

Last updated 6 months ago

Static vars are pieces of a sample that can be replaced with a string while injecting them

Syntax

In the sample include ${} with the var name

<sample>
  <p>Static var example: ${Var}</p>
</sample>

And on the html include a var attribute

<element var="Var:Value"></element>

Each static var must follow the Key:Value syntax

This is the resulting html using :

<element var="Var:Value">
  <p>Static var example: Value</p>
</element>

For multiple static vars separate each static var with ;

<element var="Var1:Value1;Var2:Value2"></element>

Updating vars

If changed via js, the function needs to be called to update the contents, using will remove the static var values so it can't be updated.

inject
Update
replace