Question
I would love to make some pages available with only Edittable access while preventing "full" page editing via the "Edit" link and TWiki edit window.
Can I do anything like this?
If not possible (yet) I'd like to request such an enhancement.
it would be, similarly, nice to be able to use
CommentPlugin but disallow Edit
Environment
--
VickiBrown - 19 Jan 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Well one way to do this is to create a modification of the skin you are using to remove those features and then do a Set SKIN = on that page. For example that is the way we created a limited feature version of some pages on our wiki. For example:
http://www.gpstk.org/bin/view/Documentation/WebHome
http://www.gpstk.org/bin/view/Documentation/SystemRequirements
--
RickMach - 24 Jan 2007
That is one way.
Another option is to modify the skin to conditionally show the edit button based on the existence of a variable. See
VarIF and
IfStatements for details on conditional text. See
PatternSkinCustomization entry point.
--
PeterThoeny - 24 Jan 2007
Working under the assumption that IF I can get this to work, I might be ablle to convince the Powers That Be to add a template, I tried to follow the instructions at
PatternSkinCustomization
. My test is
here
. APparently I'm doing something wrong.
I created a file named templates/view.noedit.tmpl containing the 3 lines as suggested. Then I
* Set COVER = %IF{ "$ WIKINAME='VickiBrown'" then="pattern" else="noedit" }%
I see
• Set COVER = pattern
another user of my TWiki sees
• Set COVER = noedit
but the Ediit link is still present.
Example page at
http://cfcl.com/twiki/bin/view/Sandbox/TestEditLink
What am I doing wrong?
--
VickiBrown - 29 Jan 2007
You must write the template exactly as documented, with INCLUDE "view.pattern" instead of "view":
%TMPL:INCLUDE{"view.pattern"}%
%TMPL:DEF{"topicaction"}%%TMPL:END%
%TMPL:DEF{"toolbar"}%%TMPL:END%
COVER is documented in
TWikiSkins
But you cannot use
%IF% to set a variable. I think the best solution would be to set COVER to noedit in Main.TWikiPreferences, and to set an overriding COVER in your user topic to pattern.
--
ArthurClemens - 30 Jan 2007
>
You must write the template exactly as documented,
I did write it (copy/paste) that way. I just double checked. I don't know how the text got munged in my (now fixed) verbatim section of my example page but the actual template is identical to the documented sample.
--
VickiBrown - 30 Jan 2007
>
But you cannot use
IF{ }: Empty expression
to set a variable.
Oh drat. Well, that would be the problem.
>
the best solution would be to set COVER ... in Main.TWikiPreferences, and to set an overriding COVER in your user topic
Actually, "pattern" is the standard. I suppose I could do that but it worries me. It means that somehting i'm trying for one or two pages is causing me to add code that affects everyone in the entire web. I can't accept that.
--
VickiBrown - 30 Jan 2007
Looks like time for a TWIki enhancement request. (Can't use IF to set a variable?????)
--
VickiBrown - 30 Jan 2007
I had a similar issue. I wanted to change the background color of restricted topics when they were viewed by our staff. At first, I tried setting the COVER variable with an IF statement, but that didn't work. I ended up creating a new pattern skin called
view.restrictedmanual.tmpl and adding this line to it:
<div id="patternMain">%TMPL:P{"topbarspacer"}%
%IF{
"$WIKINAME ingroup 'MegasysEmployeeGroup'"
then='<div id="patternMainContents" style="background-color:#FFD6C0;">'
else='<div id="patternMainContents">'
}%
Then, I set
COVER = restrictedmanual in each of the restricted topics.
--
Jamie Benjamin - 2015-11-19