Using @doctitle in other special functions

Hi everyone!

I am trying to create a clause where I change some of the text depending on which sub-document it appears in within the binder. I have clauses that have 80% overlap, and then slight wording changes depending on the subdocument. This is why I want to avoid creating two clauses here.

My idea was to use @doctitle as an ID to find out which sub-document is active and then use @if or similar.

I know that @doctitle is a snippet and @if needs text. I have tried using @str(@doctitle), but this returns nothing visible.

Any thoughts? Should I just go ahead and create parallel clauses instead?

Thanks a lot!

Best
Kai

Hi Kai,

In this case I would personally create two separate versions of the clause. From a technical perspective, this is easier to maintain. In addition, it makes both clauses easier to re-use, both in Clause9 and in ClauseBuddy (where such intricate conditions based on @doctitle or similar special functions would not work anyway).

In addition, using @doctitle in a condition is incrediby fragile because even the slightest change in the title of the document “breaks” the condition, resulting in the wrong text being inserted in the clause.

That said, I see no reason why the condition with @str(@doctitle) would not work - possibly the fact that it does not return anything may be a bug, @mtruyens can you check?

Hey Robbert,

thanks for the quick explanation and insights. Could you elaborate why having two clauses that are very similar is easier for maintenance? I would have guessed it would be the other way round, having only one thing to change instead of two or more.

Regarding fragility, would global snippets be a better alternative? I have started working more with them recently, but I am still learning the best usecases. I could create a global snippet with the boilerplate text, and have that be the start of each clause.

Is it be possible to use a concept that has a different concept label depending on which sub-document it appears in, but within a unified binder? E.g. #agreement is labeld “Investment Agreement” when it is in subdocument A; but “Shareholders’ Agreement” in subdocument B. This could prevent issues with renaming the @doctitle. I am unsure if I can tie concept labels to subdocuments automatically.

Thanks again!
Kai

Yes, in terms of maintaining only one clause there is an advantage of the single clause approach. However, in terms of minimising technical complexity the two clause approach has the upper hand. Minimising technical complexity is an important aspect to take into account maintenance wise because the template or clause may need to be updated in the future by someone other than yourself. They may not readily recognise why a certain constellations of conditions/special functions was used or may be less technically adept at using the software. That is why sometimes it may be advisable to opt for a more simplistic, if slightly less dynamic, approach.

Global snippets may indeed be a viable alternative here where the common language is implemented through a global snippet.

As to your question on the concept labels, that is not possible indeed. It is a core feature of Clause9 that it guarantees consistent use of terminology throughout a document/coherent set of documents so this would directly go against that.

However, I am not sure how that would help the use case here, could you please clarify?