Page MenuHomePhabricator

Add keyword __NOEDITTHISSECTION__ to disable edit link on a single section and it's sub-sections instead of the whole page
Closed, DeclinedPublic

Description

Frequently on a pages, there is a use of disabling the edit section link on one
or more section to point out that the main purpose of the page is not to edit
that particular section. the available keyword NOEDITSECTION will disable
all edit links on the page and might be too much for the actual purpouse.
Following patch will implement two new keywords, first is NOEDITTHISSECTION
which will disable the edit section of current section and all child sections,
seccond is a keyword FORCEEDITTHISSECTION to enable an edit section in a
section that is below an NOEDITTHISSECTION.


Version: 1.9.x
Severity: normal

Details

Reference
bz8515

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:34 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz8515.
bzimport added a subscriber: Unknown Object (MLST).

the patch

attachment noeditthissection.patch ignored as obsolete

updated patch

fixed some things that didn't look so good.

attachment noeditthissection.patch ignored as obsolete

updated patch

fixed logic specified by simentical and fixed a bug I found.

Attached:

I think this is generally not a good idea.

In what circumstances would this complication be useful?

ayg wrote:

  1. Templates that you don't want people visiting including pages to get edit

links for, where you don't want to remove all edit sections from the including
page. Restricting NOEDITSECTION to affect only the sections created by the
page it's on and not sections created by pages that include the page it's on
would work, but then I guess you couldn't have a template specify that the
entire page it's included into should be uneditable? Like that template on
Wikipedia that says "don't edit this, these docs are kept on Meta" and
NOEDITSECTIONs the page.

  1. ???

Sometimes it makes no sense to have an edit link in a level 5 section for example.

(In reply to comment #7)

Er, why not?

When the distinction of a couple of headings and a list isn't big. edit links
may just clutter up the page.

robchur wrote:

I still consider this a largely pointless, cosmetic change, as it doesn't
prevent the user from altering the URL and editing the section, or just editing
the whole page. It has the potential to increase the inconvenience to the user,
and in general, editors shouldn't be overriding user preferences on a per-page
basis.

For very specific uses, for example as on French Wikinews in order to disable editing the "Notes" section, it is possible:

– to replace the wiki code for the section title

– with a HTML tag including a specific class which disallows editing (by removing display of <span class="edisection">[link]</span>.

See:

[[n:fr:Modèle:Notes]] >>> <h2 class="notes" style="cursor:help" title="Notes modifiables depuis les appels de note dans le texte">Notes</h2>

[[n:fr:MediaWiki:Common.css#Apparence du titre de section « Notes »]]

and an example of use in [[n:fr:Paris Hilton, figure de la « jet set », condamnée à 45 jours de prison#Notes]]

but it is a very specific use (because this kind of section has not to be edited, the wikicode <ref> etc. for the content of the notes being written in another part of the document)

I suppose that with the new parser preprocessor this is not an issue anymore.

[[meta:Migration to the new preprocessor]] reads:

"XML headers no longer make an edit link

Headers created with <h1><h2><h3>... etc no longer create an editable section. They also do not create a section divide when editing sections. They do however add a level to the TOC as well as an anchor for linking. This allows you to add uneditable sections to a template, and still have editable sections on the page, which isn't possible with __NOEDITSECTION__."

I am given the choice to change the resolution of this bug, but I am not sure I should do it. Anyway, I'm going to be bold and mark it as WORKSFORME. If it is wrong for me (a non-dev) to do it, would someone please undo it. And also, remove that option for regular users, if possible.