| This template should always be substituted – use {{subst:User:Raladic/templates/lazySummary}}. |
Usage
editEmbed this into the summary column to wrap the summary text:
{{subst:User:Raladic/templates/lazySummary|target=Raladic-ts1|summary=Here goes whatever is currently in the summary column.}}
Upon substitution it will automatically drop a subpage and ts into the template, which are used to construct the backlink (or more importantly serves as parameter for JS lazy loading and a timestamp, which I just added for extra measure to construct part of the id for the scaffolding)
Sample output
editExample of the expanded template code it will produce on the page it is added to:
<div class="lazy-summary-container" id="lazy-summary-TestSwap2-Raladic-ts2-20250921054729">Lorem ipsum summary text.</div>
Example of the fully expanded code it will produce on root page transcluding it (note the "empty" container at the bottom, which will be dynamically filled with the summary text using on-demand lazy loading):
<div class="lazy-summary-wrapper">
<p><span class="lazy-summary-trigger" data-subpage="TestSwap1" data-target-id="lazy-summary-TestSwap1-Raladic-ts1-20250921054729" style="cursor:pointer; color:#0645ad; text-decoration:underline;">[show summary (lazy load)]</span>
</p><p>[<a href="https://en.wikipedia.org/wiki/User:Raladic/sandbox/TestSwap1#lazy-summary-TestSwap1-Raladic-ts1-20250921054729" title="User:Raladic/sandbox/TestSwap1">go to summary (link navigation)</a>]
</p>
<div class="lazy-summary-container" id="lazy-summary-TestSwap1-Raladic-ts1-20250921054729"></div>
</div>