User:Lorinda/In-Progress

From NeoWiki

< User:Lorinda(Difference between revisions)
Jump to: navigation, search
Revision as of 23:31, 31 January 2007 (edit)
Lorinda (Talk | contribs)
(How to Modify Page Styles)
← Previous diff
Current revision (19:16, 15 July 2007) (edit) (undo)
Lorinda (Talk | contribs)
(Creating an Input Field (Optional) - polish)
 
(22 intermediate revisions not shown.)
Line 1: Line 1:
-<!--This page is for Wiki articles/paragraphs I'm working on.-->+Using Fields Without Data Sources
-<!--This is a translation of the parallel French article, which is itself a translation of the Spanish article. (although the "applying styles" section of the French article was rewritten by jgd; She also wrote the "Importing Page Styles" section, I believe)-->+Sometimes you want to insert data such as name, address, etc. into a standard document without resorting to a data source. This article describes how to do so, using some of the many field types available in NeoOffice Writer.
-<!--Les styles de page sont une ressource propre à OpenOffice.org et NeoOffice. Ils vous permettent de créer des maquettes de page dans le style des logiciels de conception de livres (''logiciels'' DTP) de manière à pouvoir configurer et employer divers types de page dans un document, indépendamment du contenu de celui-ci. Les éléments personnalisables dans chaque style de page sont les suivants :+
-*Format+
-*Orientation+
-*Marges+
-*Couleur d'arrière-plan+
-*En-tête+
-*Pied de page+
-*Bordure+
-*Colonnes-->+
-Page styles are one of OpenOffice.org and NeoOffice's resources. They allow you to create page models like those created by desktop programming software. You can configure and use a variety of page types in a document, independent of its content. The following page style elements are customizable:+==Predefined Fields==
-*Format+NeoOffice includes several pre-defined fields that can be easily entered into any document. These include: date, time, page number, and page count. To insert these fields:
-*Orientation+*Click at the spot where you want the field inserted
-*Margins+*Go to the {{Menu|Insert}} menu and choose {{Menu|Fields}}
-*Background color+*Select the field type you want to insert
-*Header+-->The field is inserted
-*Footer+<br>
-*Border+
-*Columns+
-<!--==Comment créer un style de page==+==Document Specific Fields==
-Tout d'abord assurez-vous de garder ouverte la fenêtre de '''Styles et formatage''' (pressez les touches Ctrl+F11).+NeoOffice also includes some fields that make use of information from the {{Window|Properties}} window. (You can set the document properties by going to the {{Menu|File}} menu and choosing {{Menu|Properties...}}.) Three of these fields are available directly from the menu bar by choosing the {{Menu|Insert}} menu and then {{Menu|Fields}}, following the instructions above.
-Ensuite vous avez deux possibilités :+
-La première consiste à régler séparément le format des éléments d'une page et ensuite à cliquer sur l'icône de '''Styles de page''' (la quatrième à partir de la gauche). Une fois que la liste de styles de page apparait, cliquez sur l'icône qui montre une feuille avec une petite croix verte, et cliquez sur '''Nouveau style à partir de la sélection'''. Donnez au style le nom que vous désirez dans la fenêtre qui apparait et cliquez sur '''OK'''.+More fields related to document properties are available by doing the following:
 +*Click at the spot where you want the field inserted
 +*Go to the {{Menu|Insert}} menu and choose {{Menu|Fields}}
 +*Choose {{Menu|Other...}}
 +:-->The {{Window|Fields}} window opens
 +*Click on the {{Section|Document}} or {{Section|DocInformation}} tab near the top of the menu.
 +:''Which tab you need will depend on which field you want to insert.''
 +*Select the type of field you want from the {{Section|Type}} column.
 +*If necessary, choose the specific field from the {{Section|Select}} column.
 +*If needed, select the desired format from the {{Section|Format}} column.
-La seconde consiste à créer le style de page directement dans la fenêtre '''Styles et formatage'''. Cliquez sur la liste de styles de page et faites un clic droit ou Ctrl-clic. Choisissez l'option '''Nouveau...''' du menu contextuel qui apparait. Ensuite indiquez la configuration que vous désirez dans les divers onglets qui apparaissent dans la fenêtre de format de page. N'oubliez pas dans l'onglet '''Gérer''' de donner un nom au style. Ensuite cliquez sur '''OK'''.+''N.B. Not all the fields available in these two tabs are from the {{Window|Document Properties}} window. Some of the fields in these two tabs are discussed elsewhere in this wiki. See [[#Related Links|Related Links]] below. ''
 +<br>
-Tenez compte du fait que ces styles de page ne s'appliquent qu'au document que vous avez créé. Si vous désirez disposer de ces styles pour d'autres documents vous devrez créer un [[Fr:Comment_éditer_les_styles_par_défaut_et_utiliser_les_modèles|modèle]]-->+==User Fields==
-==How to Create a Page Style==+You can also insert User-defined fields. To do so;
-First of all, make sure to keep the {{Window|Styles and Formatting}} window open. {{key|Ctrl-F11}}. Then you have two options:+
-The first consists of individually setting the format of the page elements and then clicking on the '''Page Styles''' icon. (The fourth from the left). Once the style list appears, click on the icon that looks like a page with a small green cross, and click on '''New style from selection'''. Give the style a suitable name in the window which appears and click {{button|OK}}.+*Under the {{Menu|Insert}} Menu, choose {{Menu|Fields}} and then {{Menu|Other...}}
 +*Click on the {{Section|Variables}} tab
 +*Select {{prefName|User Field}} in the {{Section|Type}} column
 +*Choose the desired field format in the {{Section|Format}} column
 +**-->''Note that {{prefName|Additional formats...}} opens a dialog box allowing you to choose other formats, include date formats.''
 +*Enter a {{prefName|Name}} for the field in the appropriate box
 +**-->''Note that there cannot by any spaces in the field name.''
 +*Click on the green check symbol to create (but not insert) the field
 +**-->To delete a field from the list, select it in the {{Section|Selection}} and click on the red x.
 +*To insert the field at the cursor point, click on the {{Button|Insert}}
 +**-->''If you want the field contents to be hidden in the document, check the {{prefName|Invisible}} box before clicking {{Button|Insert}}.
 +*Create as many fields as needed, then click {{Button|Close}}
 +<br>
-The second method consists of creating the page style directly in the {{Window|Styles and Formatting}} window. Click on the list of page styles and right click or Ctrl-clic. Choose '''New''' from the contextual menu. In the window that appears, specify the settings you want in the various tabs of the page format window. Don't forget to give the style a name in the {{section|Organizer}} tab. Then click {{button|OK}}.+==Input Fields==
-Keep in mind that these page styles only apply to the document that you have created. If you wish to use these styles for other documents, you must create a [[Editing_Default_Styles_and_Using_Templates|template]].+Input fields are special fields tied to another field type. When a new document is created from a template, the user will be asked to fill in the values for all the input fields. To use Input Fields:
-<!--==Comment modifier les styles de page==+*Create [[#User Fields|User Fields]] as described above
 +::''Note that Input Fields can also relate to Set Variables''
 +*While the {{Window|Fields}} is still open, select {{prefName|InputField}} in the {{Section|Type}} column.
 +*Choose the User Field (or Variable) to which the Input Field is to be linked
 +*Enter a description in the {{prefName|Reference}} box. This is the prompt that will be shown when a user is asked to provide the value for this field.
 +*Make sure the cursor is where you want the input field to appear (usually the first place the User Field or Variable in question needs to occur in the document)
 +*Click on {{Button|OK}}
 +*Thereafter in the document, insert a "plain" User Field or Variable for that field. Whenever the Insert Field is updated, the related User Fields (or Variables) will be updated, too.
 +<br>
 +''N.B. Due to an OpenOffice.org bug, Input Fields relating to User Fields defined as dates will not retain the correct date or formatting. It will also corrupt any related User Fields inserted in the document. Therefore do not use Input Fields with User Fields defined as dates. User Fields defined as dates work correctly as long as you do not insert a related Input Field in the document.
-Une fois créés les styles de page vous pouvez toujours modifier leurs éléments comme vous le voulez. Il suffit de placer le curseur sur le nom du style de page dans la fenêtre '''Styles et formatage''' et de faire un clic droit ou Ctrl-clic. Un menu apparait, choisissez '''Modifier...''' et ensuite indiquez les changements dans la fenêtre qui s'affiche. Puis cliquez sur '''OK''' et les modifications seront prises en compte.+==Formatting Fields==
 +To format the way a field appears in your document, right-click or control-click on the field and choose {{Menu|Fields...}} from the contextual menu. A dialog box will appear, allowing you to modify the appearance of the field.
 +<br>
 +===Concerning Date Fields===
 +In the {{Window|Edit Fields}} window for Date fields, you will have a choice between Date (fixed) and Date. Date (fixed) will insert today's date, or a date with a specified offset from today. That date will remain fixed, regardless of when the document is opened. Date will insert a date that is updated each time the document is opened.
 +<br>
-Les changements que vous introduisez s'appliqueront immédiatement aux pages du document qui utilisent le style.-->+==Conditional Fields==
-==How to Modify Page Styles==+Conditional fields let you specify one of two values or text strings to use in a document, depending on the value of a related Variable. For example, a pastor might have a funeral liturgy with conditional fields inserted to supply the correct pronoun, depending on the gender of the deceased.
-Once a page style has been created, you can always modifier its elements as you like. In the {{Window|Styles and Formatting}} window, right click or Ctrl-click on the style name you want to modify. When the contextual menu appears, choose '''Modify...''' and then make the changes in the subsequent window. Then click on {{button|OK}} and the modifications will take effect.+===Setting the Variable===
 +The first thing you need to do is define and set the variable to be used in the condition.
 +*Under the {{menu|Insert}} menu, choose {{menu|Fields}} and then {{menu|Other}} (Or simply press {{Key|Command-F2}})
 +*Click on the {{section|Variables}} tab and choose {{prefName|Set Variable}}.
 +*Type a name for the variable in the {{prefName|Name}} box and a value in the {{prefName|Name}} box
 +*If you don't want the variable to be visible, you may check the {{prefName|Invisble}} box.
 +*Click {{Button|Insert}}
-The changes that you make will be immediately applied to the pages of your document which use that style.+===Creating an Input Field (Optional)===
 +If desired, you may insert an Input field tied to this variable, so that users are asked for the value of the variable when a new document is created based on this template. Use the method specified in the [[#Input Fields]] section above. Once you have created and inserted the Input field for your variable, you may delete the "plain" variable field from the document. (But be sure to leave the input field in the document).
-==How to Apply a Style to a page==+===Creating the Conditional Field===
 +*Make sure the cursor is place where you what the conditional field to appear.
 +*Under the {{Menu|Insert}} menu, choose {{Menu|Fields}} and then {{Menu|Other...}}
 +*Click on the {{Section|Functions}} tab
 +*Click on {{prefName|Conditional text}} in the {{Section|Type}} column
 +*Type the condition in the {{prefName|Condition}} box. For example: Gender=="Male"
 +:''-->For a guide to condition syntax, go to the {{Menu|Help}} menu, choose {{Menu|NeoOffice Help}} and type <tt>Conditions and Variables</tt> into the {{prefName|Search Term}} box.''
 +*In the {{prefName|Then}} box, enter the value you want if the condition is true. For example: he
 +*In the {{prefName|Else}} box, enter, the value you want if the condition is false. For example: she
 +*Click {{Button|Insert}}
-<!--==Comment appliquer un style à une page==+==Related Links==
 +:[[How to Add Page Numbers]]
 +:[[Cross-references in NeoOffice Writer|References in NeoOffice Writer]]
 +:[[Cross-references in a Master Document|References in a Master Document]]
-La page à laquelle vous voulez appliquer le style étant ouverte, ouvrez la fenêtre '''Styles et formatage'''. Vous avez plusieurs possibilités :<br/>+==Related External Links==
-* Faites un double-clic sur le style désiré, il s'appliquera immédiatement à la page ouverte.+[http://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=3739&highlight=fields Brief discussion of Input and User Fields at trinity]<br>
-* Sélectionnez le style désiré et cliquez sur l'icône montrant une verseuse, puis cliquez dans la page et le style sélectionné s'appliquera immédiatement.+[http://www.oooforum.org/forum/viewtopic.phtml?t=48211&highlight=input+field A thread on Input and User Fields at the OpenOffice.org Forum] (This is the same thread referred to in the trinity link above)<br>
-* Vous pouvez aussi utiliser la barre d'état. La seconde option qui apparait dans la barre d'état (de gauche à droite dans la barre par défaut) indique le style de page de la page où se trouve le curseur. Un double-clic sur cette option fait apparaître la fenêtre de dialogue qui permet de modifier le style de page. Mais si vous faites un clic droit ou Ctrl-clic la liste de styles de page disponibles apparait, choisissez celui que vous voulez et il s'appliquera immédiatement à la page en question. +[http://searchenterpriselinux.techtarget.com/tip/0,289483,sid39_gci1191662,00.html Skip the User Fields...] An article by Solveig Haugland describing how to use XML Forms instead of Input Fields. Part-way through the article there is a link to a PDF files with instructions for Input Fields.<br>
-NB: Parfois la modification du style d'une page peut provoquer des changements dans les pages suivantes. Pour éviter cela, vérifiez les styles en relation avec le style de page que vous utilisez. Cela se fait en plaçant le curseur sur le nom du style et faisant un clic-droit ou Ctrl-clic. Choisissez '''Modifier...''' et dans l'onglet '''Gérer''' vérifiez que le style apparait dans l'option '''style de suite'''. Assurez-vous que s'y trouve le style de page que vous voulez pour les pages suivantes du document que vous êtes en train de formater.+A series of articles on fields by Bruce Byfield:
- +:[http://www.linuxjournal.com/article/8071 Fielding Questions, Part 1 - The Basics]<br>
-Un autre moyen d'éviter ce problème est de placer des sauts de page manuels à la fin de la page ou du groupe de pages que vous voulez modifier. Pour cela sélectionnez l'entrée '''Saut manuel...''' dans le menu '''Insérer'''. Dans la fenêtre qui apparait vous pouvez choisir dans l'option '''style''' celui que vous aimeriez voir dans la (les) page(s) suivante(s).+:[http://www.linuxjournal.com/article/8112 Fielding Questions, Part 2 - Cross References and User-Defined Fields]<br>
--->+:[http://www.linuxjournal.com/article/8154 Fielding Questions, Part 3]<br>
- +:[http://www.linuxjournal.com/article/8238 Fielding Questions, Part 4 - Mail Merges]
-==How to Import a Page Style Page==+
- +
-You can import a page style created in an older document into the current document you are formatting. <br/>+
-*Open the window '''Styles and Formatting,''' select the type of style you want to import (First page, right page, etc.), then click on the last icon on the right (the one which shows a page with a small green cross) and chose '''Load Styles...'''+
-*In the dialog box that opens, check the '''Page''' box and click on {{button|From File...}}+
-*Choose the document from which you want to import the style and click on {{button|Open}}.<br/>+
-The imported style can be found in the '''Custom Styles''' category. You can now apply the style to your page as explained above.+
- +
-<!--==Comment importer un style de page==+
-Vous pouvez importer un style de page créé dans un document plus ancien dans le document que vous êtes en train de formater.<br/>+
-* Ouvrez la fenêtre '''Styles et formatage''', sélectionnez le type de style que vous voulez importer (Première page, Page de droite, etc), puis cliquez sur la dernière icône à droite (celle qui montre une feuille avec une petite croix verte) et sélectionnez '''Charger les styles'''.+
-* Dans la fenêtre de dialogue qui s'ouvre, cochez la case '''Pages''' et cliquez sur le bouton '''À partir d'un fichier'''.+
-* Choisissez le document dont vous voulez importer le style de page et cliquez sur '''Ouvrir'''.<br/>+
-Le style importé se trouve dans la catégorie '''Styles personnalisés''' et vous pouvez l'appliquer à votre page comme il est dit dans la section précédente.-->+
- +
- +
-<!--==Thèmes liés==+
-[[Fr:Comment_éditer_les_styles_par_défaut_et_utiliser_les_modèles|Comment éditer les styles par défaut et utiliser les modèles]]+
- +
-<!--[[Es:Cómo numerar páginas|Cómo numerar páginas]]-->+
- +
-{{botlangbarFR|[[Es:Cómo usar estilos de página|Español]]}}+
- +
- +
-[[Category:NeoOffice]][[Category:Tips and Hints]+

Current revision

Using Fields Without Data Sources

Sometimes you want to insert data such as name, address, etc. into a standard document without resorting to a data source. This article describes how to do so, using some of the many field types available in NeoOffice Writer.

Contents

Predefined Fields

NeoOffice includes several pre-defined fields that can be easily entered into any document. These include: date, time, page number, and page count. To insert these fields:

  • Click at the spot where you want the field inserted
  • Go to the Insert menu and choose Fields
  • Select the field type you want to insert

-->The field is inserted

Document Specific Fields

NeoOffice also includes some fields that make use of information from the Properties window. (You can set the document properties by going to the File menu and choosing Properties....) Three of these fields are available directly from the menu bar by choosing the Insert menu and then Fields, following the instructions above.

More fields related to document properties are available by doing the following:

  • Click at the spot where you want the field inserted
  • Go to the Insert menu and choose Fields
  • Choose Other...
-->The Fields window opens
  • Click on the Document or DocInformation tab near the top of the menu.
Which tab you need will depend on which field you want to insert.
  • Select the type of field you want from the Type column.
  • If necessary, choose the specific field from the Select column.
  • If needed, select the desired format from the Format column.

N.B. Not all the fields available in these two tabs are from the Document Properties window. Some of the fields in these two tabs are discussed elsewhere in this wiki. See Related Links below.

User Fields

You can also insert User-defined fields. To do so;

  • Under the Insert Menu, choose Fields and then Other...
  • Click on the Variables tab
  • Select User Field in the Type column
  • Choose the desired field format in the Format column
    • -->Note that Additional formats... opens a dialog box allowing you to choose other formats, include date formats.
  • Enter a Name for the field in the appropriate box
    • -->Note that there cannot by any spaces in the field name.
  • Click on the green check symbol to create (but not insert) the field
    • -->To delete a field from the list, select it in the Selection and click on the red x.
  • To insert the field at the cursor point, click on the Insert
    • -->If you want the field contents to be hidden in the document, check the Invisible box before clicking Insert.
  • Create as many fields as needed, then click Close


Input Fields

Input fields are special fields tied to another field type. When a new document is created from a template, the user will be asked to fill in the values for all the input fields. To use Input Fields:

Note that Input Fields can also relate to Set Variables
  • While the Fields is still open, select InputField in the Type column.
  • Choose the User Field (or Variable) to which the Input Field is to be linked
  • Enter a description in the Reference box. This is the prompt that will be shown when a user is asked to provide the value for this field.
  • Make sure the cursor is where you want the input field to appear (usually the first place the User Field or Variable in question needs to occur in the document)
  • Click on OK
  • Thereafter in the document, insert a "plain" User Field or Variable for that field. Whenever the Insert Field is updated, the related User Fields (or Variables) will be updated, too.


N.B. Due to an OpenOffice.org bug, Input Fields relating to User Fields defined as dates will not retain the correct date or formatting. It will also corrupt any related User Fields inserted in the document. Therefore do not use Input Fields with User Fields defined as dates. User Fields defined as dates work correctly as long as you do not insert a related Input Field in the document.

Formatting Fields

To format the way a field appears in your document, right-click or control-click on the field and choose Fields... from the contextual menu. A dialog box will appear, allowing you to modify the appearance of the field.

Concerning Date Fields

In the Edit Fields window for Date fields, you will have a choice between Date (fixed) and Date. Date (fixed) will insert today's date, or a date with a specified offset from today. That date will remain fixed, regardless of when the document is opened. Date will insert a date that is updated each time the document is opened.

Conditional Fields

Conditional fields let you specify one of two values or text strings to use in a document, depending on the value of a related Variable. For example, a pastor might have a funeral liturgy with conditional fields inserted to supply the correct pronoun, depending on the gender of the deceased.

Setting the Variable

The first thing you need to do is define and set the variable to be used in the condition.

  • Under the Insert menu, choose Fields and then Other (Or simply press Command-F2)
  • Click on the Variables tab and choose Set Variable.
  • Type a name for the variable in the Name box and a value in the Name box
  • If you don't want the variable to be visible, you may check the Invisble box.
  • Click Insert

Creating an Input Field (Optional)

If desired, you may insert an Input field tied to this variable, so that users are asked for the value of the variable when a new document is created based on this template. Use the method specified in the #Input Fields section above. Once you have created and inserted the Input field for your variable, you may delete the "plain" variable field from the document. (But be sure to leave the input field in the document).

Creating the Conditional Field

  • Make sure the cursor is place where you what the conditional field to appear.
  • Under the Insert menu, choose Fields and then Other...
  • Click on the Functions tab
  • Click on Conditional text in the Type column
  • Type the condition in the Condition box. For example: Gender=="Male"
-->For a guide to condition syntax, go to the Help menu, choose NeoOffice Help and type Conditions and Variables into the Search Term box.
  • In the Then box, enter the value you want if the condition is true. For example: he
  • In the Else box, enter, the value you want if the condition is false. For example: she
  • Click Insert

Related Links

How to Add Page Numbers
References in NeoOffice Writer
References in a Master Document

Related External Links

Brief discussion of Input and User Fields at trinity
A thread on Input and User Fields at the OpenOffice.org Forum (This is the same thread referred to in the trinity link above)
Skip the User Fields... An article by Solveig Haugland describing how to use XML Forms instead of Input Fields. Part-way through the article there is a link to a PDF files with instructions for Input Fields.

A series of articles on fields by Bruce Byfield:

Fielding Questions, Part 1 - The Basics
Fielding Questions, Part 2 - Cross References and User-Defined Fields
Fielding Questions, Part 3
Fielding Questions, Part 4 - Mail Merges
Personal tools