You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-3Lines changed: 42 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -202,9 +202,14 @@ The resulting markup would be:
202
202
</table>
203
203
```
204
204
205
-
**OR Alternatives:** If it is not certain that a token will resolve or exist, alternatives can be supplied, separated by a pipe `|` character. These will by tried from left-to-right until a key resolves. If none resolve, then an empty string results.
205
+
**OR Alternatives:** If it is not certain that a token will resolve or exist, alternatives can be supplied, separated by a pipe `|` character. These will by tried from left-to-right until a key resolves. If none resolve, then an empty string results. Or, if a string is provided as the final alternative, it will be inserted. **NOTE:** OR Alternatives will *not* work within a [combineString transformer](#transformers).
**OBJECT Notation:** Tokens can be JavaScript-compliant Object dot.notation or braced[addressing]. These can be used exactly as a simple token would be used, including in OR Alternatives.
Once instantiated in the web client code, the microdata-template can be addressed via a variety of public methods, getters, and setters. These methods can be addressed within the scope of the instantiation, or via the browser's JavaScript console.
256
+
```javascript
257
+
// In pre-ES6 implementations, the code is exposed to the global namespace:
258
+
var templater =window.MicrodataTemplate.init();
259
+
templater.getVerson(); // returns current version, e.g. "2.2.0"
260
+
261
+
// In ES6 implementations, the import code does not require init()
0 commit comments