Template:Excerpt: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
mNo edit summary
m (note on sub-sections)
Line 11: Line 11:
== Warnings ==
== Warnings ==
* If the excerpted section title changes or is removed from the source page, the excerpt will no longer work. Consider adding an HTML comment to the page being excerpted so that editors of that page in the future know not to change the title of the section. For example:<br><code><nowiki><!-- This section is excerpted in other places using Template:Excerpt.</nowiki></code><br><code><nowiki>Please do not change the section title without updating the other pages that excerpt it. --></nowiki></code>
* If the excerpted section title changes or is removed from the source page, the excerpt will no longer work. Consider adding an HTML comment to the page being excerpted so that editors of that page in the future know not to change the title of the section. For example:<br><code><nowiki><!-- This section is excerpted in other places using Template:Excerpt.</nowiki></code><br><code><nowiki>Please do not change the section title without updating the other pages that excerpt it. --></nowiki></code>
* This template will include everything either until another section header is reached or the end of the page is reached. As a result, it can include navboxes, categories, or other content depending on the location of the excerpted section. To avoid this, you can wrap any subsequent content (such as a navbox or category) inside &lt;noinclude&gt;&lt;/noinclude&gt; tags on the page from which you are excerpting content.
* This template will include everything either until another section header is reached or the end of the page is reached. As a result, it can include: navboxes, categories, sub-sections with a lower heading level, as well as other content depending on the location of the excerpted section. To avoid this, you can wrap any subsequent content (such as a navbox or category) inside &lt;noinclude&gt;&lt;/noinclude&gt; tags on the page from which you are excerpting content.


[[Category:Templates]]</noinclude>
[[Category:Templates]]</noinclude>

Revision as of 18:13, 20 December 2021

Allows you to include an excerpt from a section on another page. Also adds the Pages with excerpts category.

Example: {{Excerpt|Quickness#Action Cost Modifiers}}

Limitations

  • Note that if the section linked to includes spaces, such as Quickness#Action_Cost_Modifiers, you must omit the underscores to avoid causing a parsing error with this template.
  • This template can only be used on sections with a section header level of 2 or deeper (i.e. ==, ===, etc)

Warnings

  • If the excerpted section title changes or is removed from the source page, the excerpt will no longer work. Consider adding an HTML comment to the page being excerpted so that editors of that page in the future know not to change the title of the section. For example:
    <!-- This section is excerpted in other places using Template:Excerpt.
    Please do not change the section title without updating the other pages that excerpt it. -->
  • This template will include everything either until another section header is reached or the end of the page is reached. As a result, it can include: navboxes, categories, sub-sections with a lower heading level, as well as other content depending on the location of the excerpted section. To avoid this, you can wrap any subsequent content (such as a navbox or category) inside <noinclude></noinclude> tags on the page from which you are excerpting content.