How to set up a new field from a style?

Hello there.
I’m setting up a new document : master file and subdocuments for each chapter. Each of these is supposed to have a chapter ToC on its first page, and the name of the chapter in the header.
My problem is as follows : if I use heading 1 for the chapter title style, it will appear in the ToC (which is unwanted). As far as I understand, you can define which is the last level taken into account for a ToC, but you can’t define the starting level, it has to be level 1.
So I tried to use the Title style for the chapter title, and it works as far as the ToC. However, in doing so I lose the ability to set my header field from style (only way to do it is to go int the doc properties to set the title.

So, of course, I could use that last method, but it’s a bit of a pain for a few reasons. The ideal solution would be to be able to create a new field from the Title style (the way it works if you choose the chapter field and a level).
Any way to do that ?

It is quite easy to “omit” levels in a TOC without disturbing the Heading n usage. You play both on the TOC structure and the formatting of its entries. And there are at least two ways of doing it. The choice mainly depends on whether you base your master and subs on the same template or not.

The easy way

Prepare your chapter as usual with its heading formatted as Heading 1 and field Chapter name in the header.

Customise paragraph style Contents 1, Font Effects tab to tick Hidden effects.

A more sophisticated approach

This second proposal allows for more complex effects and is probably too contorted in the vast majority of cases.

Change the structure of the TOC Entries with a righ-click in the TOC and Edit index. In level 1, click on the structure items and press Del. You remove them, eventually leaving an empty line. The TOC entry for level 1 reduces to an empty line. You can adjust its height by customising Contents 1 Font and Indents & Spacing.

Remark

Remember that styles are independent in the master and subdocuments. Consequently, you can have paragraphs formatted under the same style name (quite handy when you have a common template) but overrides can be applied in each file, allowing to deviate a bit from the common template (not recommended because it may introduce undesirable inconsistencies but possible in certain specific cases) to get targeted formatting.

I didn’t think of the second solution. That works, thanks !

Though it would be nice to have a way to define a new field from a style…

The feature behind the Chapter name/number field requires specific processing in the text flow. It is targeted to provide running reference to the document outline.
Document outline has two components: a paragraph style family and a list style (very badly chosen name because it designates a multi-level sequence counter, mainly used in lists but can also have other applications) for the numbering.
The paragraph styles are identified by a property in their Outline & List tab where the style can be attached to an outline level. In this same tab, the paragraph style can be linked to a list style to receive a number.
When a page break occurs, Writer takes a snapshot of the current outline state and stores references to the appropriate paragraphs in the Chapter xxx fields.
As you see, this field is not based on style but on a specific property related to outline.

Therefore it does not make sense to request field contents based on style because the base trigger is outline. And you can already change the captured style by setting the outline property. The most recent paragraph at each level will be captured.

What you seem to suggest would be to user-define some “trigger” similar to outline to which you could hierarchically attach paragraph styles and have similarly behaving field. If you can write a clean specification with use cases, I would be glad to personally discuss it. Next, this spec should be forwarded to developers with a good rationale. But don’t be in a hurry because there are loads of bugs to be fixed before adding a new feature which will have also to be debugged and maintained.

I had already seen the parameter in Outline, but I had no idea of the underlying mechanism. Way more involved than expected.
That said, I believe this would e a useful feature (it would make be much more flexible than the outline level one). I’ll try to think of a way to present properly, but that’s going to take a it of time.

Anyway, thanks for the detailed answers.