Download page Using show/hide logic for pages and sections.
Using show/hide logic for pages and sections
You can apply show/hide logic to whole content pages or sections by using Boolean statements. The upcoming sections give you the steps to make it happen—and some examples to follow.
Setting up Logic Statements
To enter logic for a page or section
Hover over the page or section title in the Table of Contents panel and click the gear icon.
Click Edit Properties.
Enter the boolean statement at the bottom of the pop-up window in the Include Logic field.
Page Logic Examples
Document Scripting requires you use only lowercase letters. In the upcoming example, the actual variable is Opportunity_Name, but when using the .include? method, you use opportunity_name.
Single Variable
Opportunity_Name = “Test Opportunity”
You can check whether a variable includes certain text by using the following method: opportunity_name.include?(“Test”)
Result: Because our Opportunity_Name includes the text “Test” the example returns true.
Arrays: Include
The method .include? on an array looks for an exact match of the value in the variable you’re searching. If no exact match can be found, the method will return: false and the content will “hide”
Results:products.include?(“Name”, “product”) = content will NOT showproducts.include?(“Name”, “Test product”) = content will showproducts.include?(“Name”, “GenWatt 1000”) = content will showproducts.include?(“Name”, “GenWatt”) = content will NOT show
Arrays: Like
The method .like? on an array determines whether the value is contained in the variable you are searching.
Results:products.like?(“Name”, “product”) = content will showproducts.like?(“Name”, “Test product”) = content will showproducts.like?(“Name”, “GenWatt 1000”) = content will showproducts.like?(“Name”, “GenWatt”) = content will showproducts.like?(“Name”, “Products”) = content will NOT show