About Arbortext Styler > Working with Properties > Hiding Element Content
  
Hiding Element Content
You can suppress element content that you don't want to display in Arbortext Editor or in output.
Example: Hiding Element Content Using the Hidden Style
The following example describes how to hide the content of the bookinfo element at all times, by applying the Hidden style to the element.
1. In Arbortext Editor, open the transport.xml sample document located at Arbortext-path/samples/styler.
2. Choose Styler > Edit Stylesheet to open the associated stylesheet for edit. This is a read only stylesheet so you will need to save a local copy.
3. In Arbortext Styler, select the bookinfo element from the Elements list.
4. Select the Hidden style from the Style dropdown list, accessed via the Edit > Style menu option.
5. In Arbortext Styler, choose Preview > Print.
6. In the Print Preview window, note that none of the content from the bookinfo element is displayed.
Example: Hiding Element Content Using the Hidden Property and Contexts
You may want to suppress certain elements or contexts of elements in a specific output. The following example describes how to hide the content of the bookinfo element when the final document is output to HTML. This is achieved by creating a context for the element in HTML output and specifying that its content should be hidden in that context.
1. In Arbortext Editor, open the transport.xml sample document located at Arbortext-path/samples/styler.
2. Choose Styler > Edit Stylesheet to open the associated stylesheet for edit. This is a read only stylesheet so you will need to save a local copy.
3. In the Elements list, select the bookinfo element.
4. Select Block from the Style dropdown list, accessed via the Edit > Style menu option.
5. In Arbortext Styler, choose Preview > HTML File.
6. When the page displays in the browser, note that the bookinfo content displays at the top of the HTML page.
7. Back in Arbortext Styler, select the bookinfo everywhere context in the Elements list.
8. Choose HTML File from the Outputs to edit field.
9. In the Text category for the context, set the value of the Hidden field to Yes.
10. Choose Preview > HTML File.
11. When the page displays in the browser, note that the bookinfo content no longer displays.
12. In Arbortext Styler, choose Preview > Print.
13. In the Print Preview window, note the display of bookinfo content. That is because the Hidden property was only applied to the bookinfo element in its context in HTML output. The bookinfo element, and its content, will still display in all other outputs.
Example: Hiding Element Content Using the Hidden Property and a Condition
The following example describes how to hide graphics in a document when the role attribute of the book element is set to a value of nograph. This is achieved by creating a condition for the graphic elements based on a test for the attribute value and specifying that graphics should not appear in the document when the condition matches.
1. In Arbortext Editor, open the transport.xml sample document located at Arbortext-path/samples/styler.
2. Choose Styler > Edit Stylesheet to open the associated stylesheet for edit. This is a read only stylesheet so you will need to save a local copy.
3. In Arbortext Editor, click inside the book element at the top of the document, and set the role=”nograph” attribute for the element.
4. In Arbortext Styler, select the inlinegraphic everywhere context, and then choose Insert > Condition to create a new condition for the element.
5. In the New Condition dialog box that opens, click New Attribute Test.
6. In the New Attribute Test dialog box that opens, activate the Ancestor option, and select book from the drop down list.
7. Select role from the drop down list in the Attribute Name field.
8. In the Attribute value field, check the Includes whole word option and type nograph in the text box to the right of the option.
9. Click OK to save the test and exit the dialog box. The attribute test “role” of element “book” includes the whole word “nograph” is listed in the Tests area of the New Condition dialog box.
10. Click OK to save the condition and exit the dialog box. In the Elements list, note that you have created the condition If attribute “role” of element “book” includes the whole word “nograph” for the inlinegraphic everywhere context.
11. Highlight the condition you just created and go to the Text category.
12. Set the value of the Hidden field to Yes.
13. Select the graphic element in the Elements list, selecting all of its contexts.
14. Repeats steps 4–13 for the graphic element, to create the condition If attribute “role” of element “book” includes the whole word “nograph” for all contexts of the element.
You have now specified that no inlinegraphic or graphic elements should be displayed in your document when the top level element of the document, i.e. book, has the attribute role=”nograph” set.
15. Choose Preview > Print.
16. In the Print Preview window, note that the document contains no graphics.
17. In Arbortext Editor, delete the role=”nograph” attribute from the book element.
18. In Arbortext Styler, choose Preview > Print again. In the Print Preview window, note that the graphics now display as set.