Question
I would like to create a TWiki addon that does not display the ability to edit pages if a user is not logged in. I am currently using
DragonSkin, and I know that I could just add a hack into the source of TWiki, but I wanted to make it an addon so that I could have a variable set in each web, to determine whether it is on or not. Thank you for any help you can offer as to how I might go about doing this, or if it is already implemented.
Environment
--
ScottJohnson - 22 Sep 2004
Answer
You could change the skin to use some
SpreadSheetPlugin magic to show a conditionally "Login" or "Edit".
Write this:
%CALC{$IF($EXACT(%WIKINAME%,TWikiGuest),<a href="%SCRIPTURLPATH%/viewauth/%WEB%/%TOPIC%">Login</a>,<a href="%EDITURL%">Edit</a>)}%
To get this:
Login
If you want to make this depend on a
Set REQUIRE_LOGIN = on WebPreferences setting you can change the condition to:
$AND($EXACT(%REQUIRE_LOGIN%,on),$EXACT(%WIKINAME%,TWikiGuest))
--
PeterThoeny - 23 Sep 2004
Thank you for your help. I'll see if I can get it to work. I greatly appreciate it.
--
ScottJohnson - 24 Sep 2004
Would it be possible to disable the entire Header and Footer like it is done on the Homepage of TWiki.org, For example even if i am logged in, TWiki.org does not show any
Login or
Edit etc. Furthermore, would there be a way to put this on a Topic level, so individual Topics can either show or hide these fields depending from Login.
--
WolfgangAlper - 02 Feb 2005
You can set a skin on an individual topic with this setting: (print skin example)
Note that this requires
TWikiRelease01Sep2004 or later. Also, make sure to
Set TOPICOVERRIDESUSER = on in the
TWiki.TWikiPreferences.
See example at
Sandbox.PerTopicSkinTest
--
PeterThoeny - 03 Feb 2005
You can have a look at the css definitions of the skin you are using.
PatternSkin for example has a div named
twikiToolBar with the edit attach etc buttons at the top. You can add a style to a topic (perhaps as an included topic):
.twikiToolBar {display:none;}
inside <style></style> tags. See for example
HideToolBarTest.
--
ArthurClemens - 03 Feb 2005
Peter, Arthur - Thank you both very much for your answers. These directions will certainly help to get the customization done.
--
WolfgangAlper - 03 Feb 2005
A new question showed up. Would it be possible to set a
skin specific to a group rather than to a user?
I.e.
- default skin for
myweb = customskin
- skin for members of group
AuthorGroup = customskin1
- skin for members of group
PowerGroup = customskin2
- etc.
P.S. Maybe i should have opened a new topic for this. If you think it makes sense I will certainly do so.
--
WolfgangAlper - 22 Feb 2005
A new question topic is preferred.
--
PeterThoeny - 23 Feb 2005
New topic created:
HowToSetSkinSpecificToGroup
--
WolfgangAlper - 23 Feb 2005