Hello!
I have a chart that shows data based on a variable $sourcetype_tok$
. The values of the dropdown list are as follows:
all
and the value *
that should represent all the categories combinedHowever, the chart's title should depend on the selected category. Until now, I have this:
<title>
Top 10: $sourcetype_tok$ domains
</title>
If the selected category is A
, it works.
However, if I select the value all
, the title will be Top 10: * domains
and I want it to be customizable. Is there a way I can insert fields such as <title>
conditionally? Or can I do something so the title would depend on the value of a token?
Thanks!
Simple. Add a change
event to your input like this:
<input type="dropdown" token="sourcetype_tok">
<...>
<change>
<condition value="*">
<set token="display_domain_names">Unfiltered</set>
</condition>
<condition value="*">
<set token="display_domain_names">$value$</set>
</condition>
</change>
</input>
This should make your input set a second token display_domain_names
which contains the text "Unfiltered" if the user selects the "all" option or the selected value if another one is selected. Use this token in your title. If label and value are different in the dropdown and label is nicer, you also have $label$
available. Docs here.
Hi, I would appreciated if any expert could show your experience:
I want my title shows
ALL Status
when * Status is showed, now I have set a second token as
<title>$displaykeystorestatus$ Status Overview</title>
if part of type is selected, then should show a certain type
<title>$form.type$ Status Overview</title>
Now either of them can be achieved separately, but I cannot make the title into the conditional one, could you help to share how to use the < change> and <condition> to combine these two scenarios? Many thanks.
Same question, just wonder how do you insert the <change>
Bec I also want to change the title based on the token condition, but <title> is not <input>, I do not find the correction to insert the <change> code
My goal is also to replace the * with ALL, thanks for support!
Simple. Add a change
event to your input like this:
<input type="dropdown" token="sourcetype_tok">
<...>
<change>
<condition value="*">
<set token="display_domain_names">Unfiltered</set>
</condition>
<condition value="*">
<set token="display_domain_names">$value$</set>
</condition>
</change>
</input>
This should make your input set a second token display_domain_names
which contains the text "Unfiltered" if the user selects the "all" option or the selected value if another one is selected. Use this token in your title. If label and value are different in the dropdown and label is nicer, you also have $label$
available. Docs here.
Exactly what I needed!
Thanks!