You can add footnotes with explanations for the wiz-text
component to e-Detailers.
NOTE: As best practice, use eWizard Editor to add and edit footnotes.
Footnotes settings
eWizard.js stores the footnotes you add in eWizard Editor in the ./common/i18n/footnotes.json
file. You can change the path to the file in the path.common.footnotes
object of the e-Detailer system settings.
// ./.ewizard/settings.json{ "path": { "common": { "footnotes": "common/i18n/footnotes.json" } }, }
eWizard Editor assigns an ID to each footnote. For example, a footnotes.json
file with the footnote_q7ct
, footnote_52gz
, footnote_s9d4
, and footnote_hn17
objects for the English eng
language.
{ "eng": { "footnote_q7ct": { "symbol": { "type": "upper-alpha", "mark": "" }, "text": "<p>My text</p>" }, "footnote_52gz": { "symbol": { "type": "upper-alpha", "mark": "" }, "text": "<p>My second text</p>" }, "footnote_s9d4": { "symbol": { "type": "custom", "mark": "%" }, "text": "<p>Custom symbol footnote</p>" }, "footnote_hn17": { "symbol": { "type": "input", "mark": "FYI" }, "text": "<p>My custom abbreviation footnote</p>" }, } }
Each footnote object has the following fields:
Field | Description |
| The footnote ID on the slide. |
| The symbol group used in the footnote. The symbol group defines what symbols you can use for the footnotes. For example, if you select the |
| The symbol used for the footnote. Modify the field value to change the symbol for the |
| The footnote text. |
TIP: For all groups except custom
and input
, eWizard Editor applies the symbols regardless of the mark
field when you apply the changes. For more information, see Footnotes in eWizard Editor.
The symbol.type
field has the following symbol groups:
Group | eWizard Editor label | Symbols |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Footnotes in the template
The footnote keys are added to the template in the <i18n>
tag of the wiz-text
e-Detailer component next to the footnote text.
In the slide index.vue
file, each footnote key is wrapped in the <sup footnotes=\"\"></sup>
CSS style.
For example, the footnote_1
, footnote_2
, footnote_3
, and footnote_4
keys:
<i18n> { "eng": { "wiz_text_a98d": "<p>My text 1<sup footnotes=\"footnote_1 footnote_2\"></sup></p>", "wiz_text_e58f": "<p>My text 3<sup footnotes=\"footnote_3\"></sup></p>", "wiz_text_26e1": "<p>My text 4<sup footnotes=\"footnote_4\"></sup></p>" } } </i18n><template> <wiz-slide class="editable-block"> <wiz-text id="wiz-text-79b9" class="default" :text="$t('wiz_text_a98d')"></wiz-text> <wiz-text id="wiz-text-c2ee" class="default" :text="$t('wiz_text_e58f')"></wiz-text> <wiz-text id="wiz-text-d373" class="default" :text="$t('wiz_text_26e1')"></wiz-text> </wiz-slide> </template>
• footnote_1
and footnote_2
belong to the upper-alpha
group.
• footnote_3
belongs to the custom
group.
• footnote_4
belongs to the input
group.
In the resulting HTML the footnotes look like this on the slide:
TIP: The input
group footnotes aren't displayed on the slides in eWizard Editor.
After you click FOOTNOTES, you can see the pop-up with the footnote text from the footnotes.json
file:
Footnotes in eWizard Editor
In eWizard Editor, you can add footnotes with predefined symbols or letters from the following groups:
• lower-alpha
• upper-alpha
• lower-roman
• symbols
You can also use your own symbol or abbreviation in the custom
or input
groups respectively.
For the lower-alpha
, upper-alpha
, lower-roman
, and symbols
groups, eWizard Editor applies symbols or letters to footnotes based on:
• The symbol or letter order in the group.
• The order you add the footnote on a slide.
TIP: Modifying the mark
value in eWizard.js doesn't affect the lower-alpha
, upper-alpha
, lower-roman
, and symbols
groups in eWizard Editor.
For example, the first footnote from the lower-alpha
group on the slide always has the first letter of the group—a
, the first footnote from the symbols
group always has the first *
symbol.
eWizard Editor skips symbols from the lower-alpha
, upper-alpha
, lower-roman
, and symbols
groups that match any of the symbols from the custom
group.
For example, if you add the letter a
as a custom
footnote symbol, the first footnote you add from the lower-alpha
group is going to be—b
.
Multiple footnotes
When you add multiple footnotes of the same group, eWizard Editor applies the symbols or letters in the same order as they appear in the group.
For example, footnote_1
—My text
and footnote_2
—My second text
belong to the same upper-alpha
group.
When you add My text
first, eWizard Editor assigns it the first letter of the upper-alpha
group—A
. After you add My second text
second, eWizard Editor assigns it the second letter of the upper-alpha
group—B
:
When you add My second text
first and My text
second, eWizard Editor assigns My second text
—the A
letter, and My text
—B
:
If the symbols used on a slide exceed the group limit, a repeated symbol is added. For example, if you added all six footnotes from the symbols
group on a slide, when you add the seventh footnote, the first symbol—*
of the first group is added twice, and on the fourteenth footnote—three times:
Footnotes module
Use the footnotes module to work with the footnotes metadata.
To use the footnotes module, add the module methods in the <script>
tag of the index.vue
file of an e-Detailer slide:
<!-- ./slides/[SLIDE_ID]/index.vue --><script> export default { mounted() { this.show = true; this.$footnotes.setSeparator(','); console.log('Current footnotes', this.$footnotes.getCurrentFootnotes()); }, }; </script>
The footnotes module checks footnotes for the current footnote localization. For more details, see Localization of footnotes.
Use the following methods of the footnotes module to add, update, or get the footnotes.json
data:
getAllFootnotes
Use the getAllFootnotes
method to get all footnotes from footnotes.json
as an array.
this.$footnotes.getAllFootnotes()
For example, to get all footnotes from footnotes.json
in the browser console:
console.log(this.$footnotes.getAllFootnotes())
After running a development build, you can view all footnote objects individually in the browser console.
getFootnotesList
Use the getFootnotesList
method to view all footnotes as a list.
this.$footnotes.getFootnotesList()
For example, to view all footnotes in the browser console:
console.log(this.$footnotes.getFootnotesList())
After running a development build, you can view the list of all footnotes in Object
of the browser console. The method returns each footnote as an object.
setFootnotesList
Use the setFootnotesList
method to set a new list of footnotes used in the e-Detailer.
this.$footnotes.setFootnotesList([OBJECT_NAME])
[OBJECT_NAME]
is the name of the object you create the list in.
For example, to set a list of footnotes in the myFootnotes
object:
this.$footnotes.setFootnotesList(myFootnotes)
Example of the myFootnotes
object:
const myFootnotes = { footnote1: { symbol: { type: 'symbols', mark: '' }, text: 'footnote1 eng text' }, footnote2: { symbol: { type: 'symbols', mark: '' }, text: 'footnote2 eng text' } }
setSeparator
Use the setSeparator
method to set a symbol that divides the footnotes on the slide.
this.$footnotes.setSeparator('[SYMBOL]')
[SYMBOL]
is the symbol you use as a divider, such as a space: , a comma: ,
, or a semicolon: ;
.
For example, to use ,
as a divider, add:
this.$footnotes.setSeparator(',')
As a result, multiple consecutive footnotes on a slide are divided by a symbol, for example, ,
:
createObserver
Use the createObserver
method to create an observer that tracks footnote changes in the resulting HTML file, when you edit, add, or delete footnote attributes in eWizard Editor. By default, the observer is activated in eWizard Editor.
this.$footnotes.createObserver()
turnOnObserver
Use the turnOnObserver
method to turn on the observer. By default, the observer is turned on.
this.$footnotes.turnOnObserver()
turnOffObserver
Use the turnOffObserver
method to turn off the observer.
this.$footnotes.turnOffObserver()
footnoteExists
Use the footnoteExists
boolean method to check if the footnote ID exists in the footnotes.json
file of your template.
this.$footnotes.footnoteExists('FOOTNOTE_ID')
FOOTNOTE_ID
is the ID of the footnote in the footnotes.json
file.
For example, the footnotes.json
file has footnote1
and footnote2
:
// ./common/i18n/footnotes.json{ "eng": { "footnote1": { "symbol": { "type": "custom", "mark": "+" }, "text": "Footnote 1 text." }, "footnote2": { "symbol": { "type": "symbols", "mark": "" }, "text": "Footnote 2 text." } }, }
If you run the footnoteExists
method with the footnote3
ID:
console.log(this.$footnotes.footnoteExists('footnote3'))
After running a development build, you can see if the footnote exists in the browser console:
isValidFootnoteType
Use the isValidFootnoteType
boolean method to check if the footnote type
is valid. The type
is considered valid if the type
field has one of the following values:
• lower-alpha
• upper-alpha
• lower-roman
• symbols
• custom
• input
this.$footnotes.isValidFootnoteType('FOOTNOTE_ID')
FOOTNOTE_ID
is the ID of the footnote in the footnotes.json
file.
For example, the footnotes.json
includes the footnote1
key:
// ./common/i18n/footnotes.json{ "eng": { "footnote1": { "symbol": { "type": "asdasd", "mark": "+" }, "text": "Footnote 1 text." } } }
Use the isValidFootnoteType
to check the validity of footnote1
.
console.log(this.$footnotes.isValidFootnoteType('footnote1'))
After running a development build, you can see if the footnote has a valid footnote type. You get a false
response, because footnote1
for eng
isn't valid:
getCurrentFootnotes
Use the getCurrentFootnotes
method to view a list of all footnotes added to the slide.
this.$footnotes.getCurrentFootnotes()
For example, to show the footnotes in the browser console:
console.log(this.$footnotes.getCurrentFootnotes())
After running a development build, you can see the data about all footnotes used on the slide in the browser console.
isAbbreviationFootnote
Use the isAbbreviationFootnote
boolean method to check if a footnote on the slide belongs to the input
symbol group.
this.$footnotes.isAbbreviationFootnote('FOOTNOTE_ID')
FOOTNOTE_ID
is the ID of the footnote in the footnotes.json
file.
For example, the footnotes.json
has the following structure:
// ./common/i18n/footnotes.json{ "eng": { "footnote1": { "symbol": { "type": "input", "mark": "FYI" }, "text": "Footnote 1 text." } } }
To check if the footnote1
belongs to the input
group, add the following code:
console.log(this.$footnotes.isAbbreviationFootnote('footnote1'))
After running a development build, you can see if a footnote on the slide belongs to the input
group.
The resulting response in the browser console:
-->-->
isCustomFootnote
Use the isCustomFootnote
boolean method to check if a footnote on the slide belongs to the custom
symbol group.
this.$footnotes.isCustomFootnote('FOOTNOTE_ID')
FOOTNOTE_ID
is the ID of the footnote in the footnotes.json
file.
For example, the footnotes.json
has the following structure:
// ./common/i18n/footnotes.json{ "eng": { "footnote1": { "symbol": { "type": "custom", "mark": "+" }, "text": "Footnote 1 text." } } }
To check if the footnote1
belongs to the custom
group, add the following code:
console.log(this.$footnotes.isCustomFootnote('footnote1'))
The resulting response in the browser console:
-->-->
isGroupFootnote
Use the isGroupFootnote
boolean method to check if a footnote on the slide belongs to one of the following symbol groups:
• lower-alpha
• upper-alpha
• lower-roman
• symbols
this.$footnotes.isGroupFootnote('FOOTNOTE_ID')
FOOTNOTE_ID
is the ID of the footnote in the footnotes.json
file.
For example, the footnotes.json
has the following structure:
// ./common/i18n/footnotes.json{ "eng": { "footnote1": { "symbol": { "type": "lower-alpha", "mark": "" }, "text": "Footnote 1 text." } } }
To check if the footnote1
belongs to one of the groups, add the following code:
console.log(this.$footnotes.isGroupFootnote('footnote1'))
After running a development build, check the browser console to see if a footnote belongs to one of the groups.
The resulting response in the browser console:
-->-->