Is a hard-coded value in a header, which differ every page, possible?

I would like to place a hard-code value in the header, which differ on every page. Is this possible?

This is already a work-around. What I would like is a chaptername Heading in the header. But this chaptername must be without numbering.

I am writing a book with stylesheet and a masterdocument. With help of this form I am quite far. The main content is ready and also the appendix. I would like to make a clear distinction between the content-text and appendix. With help of this forum I use a different page style, with headers and footers in Italic. The main content exist of numbered chapters, with on the left page the name of “Heading 1” name and on the right page the number and name of the “Heading 2”.
In the appendix, to make a clear distinction, I do not want numbering. So I copied “Heading 2” to “Heading 2 appendix” and removed the outline. This does work, but at the same time I can not refer anymore “Heading 2 appendix” content name for the header. So it has no use.

I have already a separate pagestyle for the appendix, so I am free to alter that, without influencing the main content.

Keeping “Heading 2” would give me the desired Header for the right page, because I can choose just the chaptername, without the numbering. So the Header is fine. But then my “Heading 2” will have a number, which I want to avoid.

So I can choose between a desired Heading style for my paragraph, without a number, but then my header is not available to me. Or I choose the right header, but than the paragraph style will have a number, which I do not want.

I tried a multiple work-around. First just hardcoded typing. This does work for the first page of the appendix-item, but the next appendix-item will have the same name. I thought using “Hidden paragraph” for “Heading 2” but doing so the name-label of the paragraph is hidden, not the number. I tried a field, but the same. I looked to the similarity of page numbers. The field stays the same on each page, but the content, the actual page number, differs. So I tried a field input list. I am able to select one of the list-items, but this item is placed on all the pages.

If a solution is possible with stylesheets it has my preference. But an other work-around I do not mind.

Your description is not “crystal-clear”. If you could improve it, this would help.

What I understand: you’d like to have two different header structures to make a clear distinction between chapters and appendix. Apparently, you already use field insertion to echo the current value of Heading 1 on left page and Heading 2 on right page.

Chapter number and chapter name can be inserted independently choosing the appropriate field variant in Insert>Field>More Fields, Document tab. With Type Chapter, your choice in Format is Chapter name and Chapter number instead of the combined Chapter name & number.

This goes into the header which is an attribute of the page style. Consequently, if you want a different header content (either literals or fields), you must create another page style for your appendix. Give the same characteristics as your main page style, but for header content.

Your description about Heading 2 appendix is rather confused.

Deriving it from Heading 2 gets it out of the chapter structure and it is no longer recognised as part of the “outline”. It is no longer in the Tools>Chapter Numbering hierarchy, which is one of your goals. However, for TOC and chapter references, it is necessary to place it back into the “outline” hierarchy (without numbering) by altering the Outline & Numbering tab of the Heading 2 appendix paragraph style. You must set the Outline level to 2. When this is done, your Heading 2 appendix is correctly recognised as the current level-2 heading.

There is no hard-coded value in the header to achieve your design. Hard-coded values would rather be the static text your enter into the header. Here you need “dynamic” values provided by fields which are context-sensitive.

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.

I edited my question. The main thing boils down to:
So I can choose between a desired Heading style for my paragraph, without a number, but then my header is not available to me. Or I choose the right header, but than the paragraph style will have a number, which I do not want.

Not at all.

As I said, Heading 2 appendix can be derived from Heading 2. Not being designated in Tools>Chapter Numbering, it won’t have a number (unless you messed up with the feature and added a number with the toolbar button for numbered lists – this is a common mistake by newbies). To make Heading 2 appendix recognised as a heading, you just assign it to Outline level 2 in its Outline & Numbering tab.

In the end, you have a Heading 2 appendix recognised as part of the ouline structure without a number.

Thanks Ajittoz. I made a stupid error. In the Paragraph Style of Heading 2 appendix, in the tab “Outline & Numbering” I had changed the outline level to “Text Body” instead of “Level 2”
I assume I have done so, to remove the numbering. And the numbering style is “None”.
Only the last is sufficient.

It is likely you didn’t change the outline level. When you derive (clone) from a Heading n paragraph style, the outline level automatically reverts to Text Body. This is probably done on purpose by the developers because you can have only one style per level in Tools>Chapter Numbering. But the Outline & Numbering tab allows you to attach several styles to a level, only one of them being numbered by Tools>Chapter Numbering.

This is not clearly stated in the documentation. You discover it through practice.

This seems to me indeed more probably as you described. I documented this in my custom documentation of LibreOffice