(zettel (meta (back "00001007031100") (backward "00001007031100") (box-number "1") (created "20220809132350") (forward "00001006050000 00001007030800 00001007040000 00001007040324 00001007050000") (modified "20251107193607") (published "20251107193607") (role "manual") (syntax "zmk") (tags "#manual #zettelmarkup #zettelstore") (title "Zettelmarkup: Zettel Transclusion")) (rights 4) (encoding "") (content "A zettel transclusion is specified by the following sequence, starting at the first position in a line: ''{{{zettel-identifier}}}''.\n\nWhen evaluated, the referenced zettel is read.\nIf it contains some transclusions itself, these will be expanded, recursively.\nWhen a recursion is detected, expansion does not take place.\nInstead an error message replaces the transclude specification.\n\nAn error message is also given, if the zettel cannot be read or if too many transclusions are made.\nThe maximum number of transclusion can be controlled by setting the value [[''max-transclusions''|00001004020000#max-transclusions]] of the runtime configuration zettel.\n\nIf everything goes well, the referenced and expanded zettel will replace the transclusion element after being wrapped in a [[region block|00001007030800]].\nThe region block serves two purposes: first, it marks that the content originates from a transclusion; second, it inherits the attributes of the transclusion element.\nHowever, if the element has an attribute with the key ''width'', this attribute is converted into a ''style'' attributes in the form ''style=\"width: VAL;\"'', where ''VAL'' is the value of the original ''width'' attribute.\n\nFor example, to include the text of the Zettel titled \"\"Zettel identifier\"\", just specify its identifier [[''00001006050000''|00001006050000]] in the transclusion element:\n```zmk\n{{{00001006050000}}}\n```\nThis will result in:\n:::example\n{{{00001006050000}}}\n:::\n\nPlease note: if the referenced zettel is changed, all transclusions will also change.\n\nThis allows, for example, to create a bigger document just by transcluding smaller zettel.\n\nWith a ''width'' attribute, the same transclusion results in a region block that includes the corresponding inline style, for example:\n```zmk\n{{{00001006050000}}}{width=50%}\n```\nThis will result in:\n:::example\n{{{00001006050000}}}{width=50%}\n:::\n\n\nIn addition, if a zettel __z__ transcludes a zettel __t__, but the current user is not allowed to view zettel __t__ (but zettel __z__), then the transclusion will not take place.\nTo the current user, it seems that there was no transclusion in zettel __z__.\nThis allows to create a zettel with content that seems to be changed, depending on the authorization of the current user.\n\n---\nAny [[attributes|00001007050000]] added to the transclusion will also set/overwrite the appropriate metadata of the included zettel.\nOf course, this applies only to those attributes, which have a valid name for a metadata key.\nThis allows to control the evaluation of the included zettel, especially for zettel containing a diagram description.\n\n=== See also\n[[Inline-mode transclusion|00001007040324]] does not work at the paragraph / block level, but is used for [[inline-structured elements|00001007040000]]."))