Page MenuHomePhabricator

__NOEDITSECTION__ in a template affects entire page
Closed, DeclinedPublic

Description

Author: johnwschmidt

Description:
I made some templates with many sections. If such a template is included in a
page, the page displays edit links for each section. Clicking on the edit links
for sections in the template opens the edit window for the template. In my case,
I do not want casual users editing the templates. This "feature" by which
templates can be edited from pages using templates can be blocked by including
NOEDITSECTION in the template, but this also blocks editing of sections that
do not come from the template. Is there a way to restrict the action of
NOEDITSECTION to only the sections in the template containing
NOEDITSECTION ?

Alternatively, edit links that open templates for editing should be made to look
different or give a warning about the fact that a template is being edited.


Version: unspecified
Severity: normal
URL: http://academia.wikicities.com/wiki/Language_Journal:Instructions_for_authors

Details

Reference
bz2795

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:40 PM
bzimport set Reference to bz2795.
bzimport added a subscriber: Unknown Object (MLST).

fyrenmoo wrote:

adds NOEDITTHISSECTION

This small patch adds a new directive, NOEDITTHISSECTION. Any section with
this directive in it won't have an edit link in the heading. I've only tested
it on my personal wiki, but I haven't found any problems.

Not sure if this is the best way to implement the feature, but it's an easy
way. If there's a better way to implement it, I'd appreciate the advice.

attachment patch ignored as obsolete

reworked patch

fixed the patch to work against current svn, also fixed some minor
inconsistency and reviewded it

attachment noeditthissection.patch ignored as obsolete

updated patch

added the logic that a sub section of a disabled section, shouldn't either have
an edit link

attachment noeditthissection.patch ignored as obsolete

same patch

forgot to remove a debug-statement

attachment noeditthissection.patch ignored as obsolete

new patch

added keyword FORCEEDITTHISSECTION to enable edit section on a subsection
that is under a NOEDITTHISSECTION

Attached:

This test case did I use:

Foo

NOEDITTHISSECTION

Bar

d

Baz

NOEDITTHISSECTION

a

b

c

FORCEEDITTHISSECTION

d

Quux

NOEDITTHISSECTION

Quuux

e

f

NOEDITTHISSECTION

Quuuux

robchur wrote:

No, fix the problem, don't add in another hack to work around it.

ayg wrote:

Hmm, and here I was getting close to committing. Oh, well.

stux wrote:

8515 proposes the same solution to this problem, although these are not exactly
duplicates. Marked as dependent

With the new preprocessor, you can use now <h2>Heading</h2> to generate a section without edit links.

Marking as WORKSFORME.