gesinn-it-pub / mediawiki-extensions-PageForms

Fork of MediaWiki extension PageForms that aims to simplify contribution through hosting on GitHub instead of Gerrit, improved quality through better test coverage (to be done) and continuous integration.
Other
1 stars 4 forks source link

Edit tabs when VisualEditor/VEForAll is present #61

Closed krabina closed 3 months ago

krabina commented 6 months ago

This is either a feature request or a question.

Since PageForms and VEForAll extension provide a nice way to have VE in form fields, this is nice. But the problem is how to go about the edit tabs. IMO PageForms should - on pages that use PageForms - remove the edit tab of VE. Because if you click on it, it simply does not work at all, and you don't want the users to open the whole page in VE, but instead open the form again.

There are two options: $wgVisualEditorUseSingleEditTab = true; In this case, all pages that use PageForms nicely display the edit tab that leads to formedit and the source edit button. The Problem now is that on other wiki pages (for which there is no form defined) only show a souce edit button and I don't know of a way to bring an edit button back that would give you the regular VE editor.

When $wgVisualEditorUseSingleEditTab = false; No problem on regular pages, since you have "Edit" for VE editor and "Edit source". But on pages with forms, there are three edit buttons: "Edit", "Edit with form" and "Edit source". Now we would need to remove the edit button, since it really does not make sense to visually edit a page forms created page. However, there seems to be no option to do that. And I think there should be an option in PageForms. image

How you do this? Hide the edit button via CSS?

Since VE can only be turned on an off on a per-namespace basis, I think we need the feature in PF to disable the VE edit button whenever PF is present.

thomas-topway-it commented 5 months ago

I would add the following constraint: "the form has to contain a VE editor to the free text input" like

{{{standard input|free text|autogrow|editor=visualeditor|class=form-control}}}

in the form definition. Otherwise there is not guarantee that the user can edit the page with VE

krabina commented 3 months ago

There is a solution mentioned on the PF website that involves https://www.mediawiki.org/wiki/Extension:CSS where on some pages you can use #ca-view, #ca-edit { display: none !important; } or in my case

{{#css:
  body {
    #ca-ve-edit  { display: none !important; }
  }
}}

This removes the edit-button altoghether and in the edit menu you only have the "edit with source" on pages where hardly any VE editing mages sence (like overvew pages that are mainly generated by aks queries).

So I am closing this for now.