Item12860: Page preferences change from "Set" to "Local" on page edit with NatSkin
Priority: Normal
Current State: Closed
Released In: n/a
Target Release:
Applies To: Extension
Component: NatSkin
Branches:
I recently upgraded our site to foswiki 1.1.9 and
NatSkin. A couple of users wanted to change their personal preferences so that the sidebar would not be visible or would be on the left instead of the site default which is on the right. My initial instructions to them were to edit the topic preferences with a line like this:
* Set NATSKIN_SIDEBAR = left
The problem is, the next time they edited their home pages, the setting was changed from a "Set" to a "Local" (even when they weren't changing anything on the settings tab).
As a workaround, I've asked them to enter the setting inside an html comment in the topic text instead of as a hidden preference. This seems to work, but it also seems quite awkward.
Ideally, it would be great if the plugin could detect that it's operating on a user page (in my case this might be done based on the view template being used - no UserForm is present) and actually provide the option to apply each setting locally or globally and then remember that preference. Normally it seems like a Local setting is the right thing to do, but in the case of user preferences the option of a global setting is very useful.
--
LeilaPearson - 17 Apr 2014
MichaelDaum, is this a pure
NatSkin related issue? I can't recreate it on trunk.foswiki.org.
--
GeorgeClark - 24 Dec 2014
George, yes that's a pure
NatSkin feature reqest.
Leila, I think what you propose is a good idea. This needs further thinking how to implement this in
NatEditPlugin's "Settings" tab in an understandable usable way.
Besides the technical problem - as you already mentioned - to reliably distinguish editing a profile page versus a normal topic. Setting preferences in user profiles can have a more global effect as well as in WebPreferences and SitePreferences.
--
MichaelDaum - 24 Dec 2014
Here's a patch to fix it quickly in
templates/edit.nat.tmpl
... at least for
NOWYSIWYG
for now
%TMPL:DEF{"editsettings::wysiwyg"}%<tr>
<th>%MAKETEXT{"Wysiwyg"}%<input type='hidden' name='Default+NOWYSIWYG' value='undefined' /></th>
<td>
- <label><input type='radio' class='foswikiRadioButton' name='Local+NOWYSIWYG' value='undefined' %IF{"preferences[name='NOWYSIWYG'].value=''" then="checked"}% />%MAKETEXT{"default"}%</label>
+ <label><input type='radio' class='foswikiRadioButton' name='%TMPL:P{"editsettings::wysiwyg::var"}%' value='undefined' %IF{"preferences[name='NOWYSIWYG'].value=''" then="checked"}% />%MAKETEXT{"default"}%</label>
</td>
<td>
- <label><input type='radio' class='foswikiRadioButton' name='Local+NOWYSIWYG' value='off' %IF{"preferences[name='NOWYSIWYG'].value='off'" then="checked"}% />%MAKETEXT{"on"}%</label>
+ <label><input type='radio' class='foswikiRadioButton' name='%TMPL:P{"editsettings::wysiwyg::var"}%' value='off' %IF{"preferences[name='NOWYSIWYG'].value='off'" then="checked"}% />%MAKETEXT{"on"}%</label>
</td>
<td>
- <label><input type='radio' class='foswikiRadioButton' name='Local+NOWYSIWYG' value='on' %IF{"preferences[name='NOWYSIWYG'].value='on'" then="checked"}% />%MAKETEXT{"off"}%</label>
+ <label><input type='radio' class='foswikiRadioButton' name='%TMPL:P{"editsettings::wysiwyg::var"}%' value='on' %IF{"preferences[name='NOWYSIWYG'].value='on'" then="checked"}% />%MAKETEXT{"off"}%</label>
</td>
</tr>%TMPL:END%
+%TMPL:DEF{"editsettings::wysiwyg::var"}%%IF{
+ "preferences[name='NOWYSIWYG']"
+ then="%QUERY{"preferences[name='NOWYSIWYG'].type"}%"
+ else="%IF{
+ "'%WEB%.%TOPIC%'='%USERSWEB%.%WIKINAME%'"
+ then="Set"
+ else="Local"
+ }%"
+}%+NOWYSIWYG%TMPL:END%
--
MichaelDaum - 16 Nov 2015
Added to latest release
--
MichaelDaum - 23 Jan 2017