How to add a field (with a variable) inside a geometric form with text inside?


I did a colored left border with a long retangle shape. On top of that colored border, I want to put other geometry shapes with text inside on top of the colored border. This text needs to contain fields with variables such as page-number, author-name, date…

How to do that? The field button isn’t selectable with a geometrical shape…

Thank you,

Joel Lapointe

In French site as: Est-il possible d'insérer un champ automatique(variable) dans une forme avec du texte à l'intérieur?

Press F5 to open the Navigator, double click there on the shape name (under Drawing objects), press the context menu key, and click Add Text Box.

Shapes are no clickable objects in Writer.

Tested with LibreOffice (x86); OS: Windows 6.1.

Add Answer is reserved for solutions. If you think the answer is not satisfactory, add a comment below, or click edit (below your question) to add more information.

Check the mark (Answer markCorrect answer mark) to the left of the answer that solves your question.

You can’t insert fields into graphic objects.

Your approach is faulty. Graphic objects are offered as a poor substitute for complete drawing built with Draw. These drawings/objects are “passive” with regard to Writer main flow (they are totally separate from it).

Insert>Frame creates a secondary text flow. You can type inside any text you like, style it, add fields to retrieve information related to the document. However I don’t recommend you insert fields connected with the main flow, such as current chapter name, because the order in which Writer manages the frames may sometimes not be what you expect and you end up with “unsynchronised” replacements.

Your question does not tell what you intend this frame for. This is very important to define the anchor point.

From your description I guess (but not sure about it) that you want it to be repeated on every page. This means your frame must be part of the header. Therefore the frame must be anchored To paragraph attached to a header paragraph.

Then to position it accurately, right-click on the frame and Properties.

Horizontal Position should be Center to Left page border.

Vertical Position should be From top by xxx cm to Entire page

Tune the frame size to the required dimension and set its Area colour to simulate your page coloured border.

Additional graphic objects can be added and anchored inside the frame.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

@ajlittoz, I never used before Horizontal Position as Center to Left page border. First time now. Maybe a wording issue with me. To me border is the outer edge of the page (so object will rest half in and half out), and margin is the area between the border and the page content (as defined in Page Style).

@LeroyG: there is definitely a wording issue here. Prior to version 7.x, it was called Left Margin. When I upgraded to I was a bit upset by the numerous vocabulary changes. I wonder if this is a lonely developer initiative or if it has been fully discussed and approved by the quality team.

Note: my edit only fixed a formatting error. Nothing added to the answer.

Finally, I was able to put fields into a square geometrical shape the method is :

  • Right-click on the shape
  • Chose Add a text box (this is inserting a textbox inside the shape. This text box is different than the simple text field when clicking on the shape. It allows complicated formating including data-fields)

However, I have another problem about it. I’m not able to turn the text as the shape is turned 90 degres. The screenshot is there : Link

Once again, don’t use graphic objects for fundamentally textual data. In graphic objects, text is considered graphics; you won’t be able to format it as in Writer.

A text box is yet another kind of object, related to forms. Since it is provided for data entry or labelling other controls, there is no reason to rotate it. Remember that drawing capabilities in Writer are far less sophisticated than in Draw. Therefore a rotation in an outer non-grouped object does not forward to the inner object.

Text should go into a “container” made for text. In your case use a frame. Create a dedicated paragraph style for the frame content. In the Position tab of this paragraph style, select the desired orientation: 90 degrees or 270 degrees depending on your choice of bottom-to-top or top-to-bottom reading direction.