Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article, we explained how you can add conditions to your deployment. In the following article, we will elaborate a bit more on the JS Variable condition.

The values you set in in the conditions are stored as a String. This has some implications if you want to check for a Boolean value in the variable on your page.

JS Variable if the condition is true

Let’s say your specified variable, var1 is true. Adding the condition var1=true will not work, as “true” != true. If var1 is true (boolean), you could use the condition var1=1.

JS Variable if the condition is false

Let’s say your specified variable, var1 is false. Adding the condition var1=false will not work, as “false” != false. If var1 is false (boolean), you could use the condition var1=0.


Easy html macro
theme{"label":"solarized_dark","value":"solarized_dark"}
contentByMode{"html":"<div id=\"surveyContent\"></div>","javascript":"var confluenceData = {};\nvar pageId;\nvar pageTitle;\n\ntry {\n confluenceData = JSON.parse(parent.window.name);\n var pageId = confluenceData.options.productContext['page.id'];\n var pageTitle = confluenceData.options.productContext['page.title'];\n} catch(e) {}\n\nvar src = 'https://collect.mopinion.com/assets/surveys/2.0/js/survey.min.js';\n\nvar vars = {\n key:'211a4fdb96626776846147095cc335b448e20458', \n domain:'app.mopinion.com', \n divName:'surveyContent', \n button:false, \n use_collect:false, \n useQuerySelectorAll:false\n};\n\nvar s = document.createElement('script');\ns.async = 'async';\ns.id = 'mopinionFeedbackScript';\ns.src = src;\ns.onload = s.onreadystatechange = function() {\n if (!s.readyState || s.readyState === 'loaded' || s.readyState === 'complete') {\n try {\n srv.loadSurvey(vars);\n } catch (e) {}\n }\n}\ndocument.head.appendChild(s);","css":""}
Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@957
sortmodified
showSpacefalse
reversetrue
typepage
cqllabel in ( "javascript" , "conditions" , "deployment" ) and type = "page" and space = "KB"
labelsdeployment javascript conditions