Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

OpenOffice Writer 3.x Guide
Previous Page Home Next Page

Apply the condition to the content

Now that you have defined the variable, you can use it in a condition statement. This topic describes some of the possibilities.

Conditional text

First, let us set up some conditional text that will insert the words “Great Product Lite” into the Lite version and “Great Product Pro” into the Pro version of the manual. You would use this field whenever you want to mention the name of the product.

  1. Place the cursor where you want one of these phrases to appear. (You can move or delete it later, if you wish.)
  2. Open the Fields dialog box by clicking Insert > Fields > Other, select the Functions tab, and select Conditional text in the Type list.
  3. As shown below, type ProLite EQ "Lite" in the Condition box, Great Product Lite in the Then box, and Great Product Pro in the Else box.
  4. Image:documentation_note.png These fields are case-sensitive, and quotation marks are required around a text value such as Lite.
    Inserting conditional text.
  5. Click Insert to insert the field, then click Close. You should see Great Product Lite in your text.
Image:Tip.png If you want to insert this field into your text in many places (as you probably would for a product name), create an AutoText entry for it. See Using AutoText to insert often-used fields for instructions.

Hidden text

You might use hidden text for words or short phrases that describe features of Great Product Pro that are not found in the Lite version. You can reuse the same field in several places in your document—for example, by copying and pasting it.

To create a hidden text field:

  1. Click Insert > Fields > Other and select the Functions tab.
  2. Select Hidden text in the Type list, as shown below.
  3. Type ProLite EQ "Lite" in the Condition box and type the required text in the Hidden text box. Remember, this is the text that is hidden if the condition is true.
  4. Click Insert to create and insert the field.
Creating a condition for hidden text.

Hidden paragraphs

Image:Tip.png To enable hidden paragraphs, remove the check mark from View > Hidden Paragraphs. When this option is selected, any hidden paragraph you create will always be hidden, whether its condition is true or not.

A paragraph is hidden if the condition is true. To hide a paragraph:

  1. Click in the paragraph to be hidden.
  2. Click Insert > Fields > Other and select the Functions tab.
  3. Select Hidden paragraph in the Type list.
  4. For this example, type ProLite EQ "Lite" in the Condition box.
  5. Click Insert to create and insert the field. If an extra paragraph mark appears, delete it.

To show hidden paragraphs so you can edit them, do one of the following:

  • Select View > Hidden Paragraphs from the menu bar, so it is checked (shows all hidden paragraphs).
  • On the Tools > Options > OpenOffice.org Writer > Formatting Aids page, select the Fields: Hidden paragraphs option (shows all hidden paragraphs).
  • Double-click in front of the variable that you used to define the condition for hiding the text, and enter a different value for the variable (shows all hidden paragraphs).
  • Double-click in front of the hidden text field or the hidden paragraph field, and change the condition statement (changes only the selected hidden paragraph).

Hidden sections

A conditional section is hidden if the condition is true. To create a conditional section:

  1. Select the text that you want to be included in the conditional section. (You can edit this text later, just as you can edit any other text.)
  2. Click Insert > Section. On the Insert Section dialog box, select the Hide checkbox and enter the condition in the with Condition box. You can also give the section a name, if you wish (strongly recommended, so you can find it again easily if you have several sections in your document).
  3. Click Insert to insert the section into your document.
Creating a section to be hidden when a specified condition is met.

To show a hidden section so you can edit it:

  1. Click Format > Sections.
  2. On the Edit Sections dialog box, select the section from the list.
  3. Deselect Hide, and then click OK. You can now edit the contents of the section. Afterwards, you can click Format > Sections again and select Hide to hide the section again.

To show all the hidden sections so you can edit them, change the value of the variable to something that the conditions will not recognize. In our example, you could change the value to 1.

To make the hidden section a normal part of the document (that is, to remove the section markers, but not the contents of the section):

  1. Show the hidden section, as described above.
  2. On the Edit Sections dialog box, select the section from the list.
  3. Click Remove. The contents of the section are now a normal part of the document.

OpenOffice Writer 3.x Guide
Previous Page Home Next Page

 
 
  Published under the terms of the Creative Commons License Design by Interspire