How do I link a Writer section using variables for File name and Section?

I occasionally prepare text documents which have many links to sections in other Writer document files. These source files/sections contain variants of the sections needed. The documents I prepare typically require all the sections, but only one version of each section. These production documents change according to requirements. Currently I link all relevant variant sections in source documents, and hide the sections not needed by specifying variable values. The problem is that the number of variant sections controlled by these variables which are not required and therefore hidden makes the production file an order of magnitude larger than needed for what is displayed and printed.

The solution I envisage selects for inclusion only those sections which are needed for the current version of the document. Variables in the production document could identify which files/sections I need. Having the ability in the insert/format section dialogue to specify a variable in the linked filename and linked section could then simplify and shrink my production document, while simplifying the condition for hiding the section.

I am quite interested in this question. I wonder if you could provide a real-world example for greater clarity? What I am thinking of is text instructions that vary according to software version or operating system. Does that sound right? I am not clear about the widespread use of “section” and how they are linked. Is the “source document” the anchor for the section link?

@GregB - What is the purpose of your files and links? Do you want to have the ability of using blocks ot text to be combined into a new document to create a new document?

@oweng: Probably not dissimilar, but different domain. “Real-world” would have to be simulated; There are copyright issues for fair use one-of events.
@ROSt53: That’s exactly correct. One (or more) file(s) would have boilerplate stuff, from which I would select relevant material, and one (or more) file(s) would hold the material more particularly relevant to this event. The final document would have some but typically not all of any source document.

All I can suggest is that you raise an enhancement bug asking for this ability as it does not currently exist. Bug fdo#57148 would appear to be related and indicative of the need to very clearly detail what is required and how it is envisaged to work. The main concerns (as I see them) will be:

  • Keeping the request / facility as simple as possible (i.e., not requiring changes to several areas) and yet still providing the required functionality.
  • Distinguishing this section and / or field-based method from that of creating smaller (component) documents that are selected / included as required into a master document, each of which is put together as required.

Perhaps the suggestion is the ability to turn on / off the visibility or inclusion of a sub-document via right-click menu option in the Navigator when editing the master document? This would allow the ability to include several variant sub-documents (e.g., legal content) and select the required one per use case.