Template:Edit-first-section

From Guild Wars Wiki
Jump to navigationJump to search

[edit]

This template shows an [edit] link (optionally in the top right corner) on the page where it is placed on (including this one). The link activates the page editor, only showing the top section of that page (&section=0). This is useful for long pages, where the only alternatives to edit the top section is to either edit the entire page, which takes a long time to load and save, or to enter the edit URL manually with "&section=0" appended.

Usage[edit]

Place the template on the first line of the page. A floating [edit] link will appear on the far right of the first line. When using the absolute keyword, the link will appear in the top right corner of the page, no matter where the template is placed.

An optional third parameter (top) can be entered when the default absolute position conflicts with another element (like another template that uses absolute positioning). It accepts CSS compatible values (ie. px or em). The default is 1em, placing the link just above the top line. Use 2.9em to place it below the line. Use higher values to place it even lower.

Tech notes[edit]

  • This works by creating a link to section 0, which includes whatever comes before the first section header.)
  • In particular, <span class="plainlinks" style={{#ifeq:{{lc:{{{1|}}}}}|absolute|"position: absolute; top: {{#if:{{{2|}}}|{{{2}}}|1em}}; right: 1em;"|"float: right; margin: 0 0 .5em 1em;"}}>[[{{fullurl:{{FULLPAGENAMEE}}|action=edit&section=0}} {{int:Editsection}}]]</span>
  • Source: Meta @Wikimedia

Example[edit]

{{Edit-first-section}}
{{Edit-first-section|absolute}}
{{Edit-first-section|absolute|top}}