• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7407: TopMenuSkin missing create topic

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine TopMenuSkin Normal No Action Required   n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


I like TopMenuSkin - but it raises a user question: "How do I create a new topic?"

The old LeftBar had a 'Create topic' button.

From a user point of view, this is a serious omission.

You can see this on twiki.org.

My solution:

In TopMenuSkinTopicMenu, make the first %IF look like this (simply add line 5, the one including 'WebCreateNewTopic'):

 else="   * %IF{"context new_topic" then="<a href='%SCRIPTURL{edit}%/%BASEWEB%/%BASETOPIC%?t=%GMTIME{$epoch}%%TMPL:P{"url_param_editaction"}%' rel='nofollow' title='Create new topic'>%MAKETEXT{"Create"}% %ICONURL{menu-down}%</a>" else="<a href='%SCRIPTURL{edit}%/%BASEWEB%/%BASETOPIC%?t=%GMTIME{$epoch}%%TMPL:P{"url_param_editaction"}%' rel='nofollow' title='Edit this topic text'>%MAKETEXT{"Edit"}% %ICONURL{menu-down}%</a>" }%
      * <a href='%SCRIPTURLPATH{"view"}%/%BASEWEB%/WebCreateNewTopic?topicparent=%BASETOPIC%' rel='nofollow'>%MAKETEXT{"Create New Topic"}%</a>
      * <a href='%SCRIPTURL{edit}%/%BASEWEB%/%BASETOPIC%?t=%GMTIME{$epoch}%%TMPL:P{"url_param_editaction"}%;nowysiwyg=1' rel='nofollow' title='Raw Edit this topic text'>%MAKETEXT{"Raw edit"}%</a>
      * <a href='%SCRIPTURLPATH{attach}%/%BASEWEB%/%BASETOPIC%' rel='nofollow' title='Attach an image or document to this topic'>%MAKETEXT{"Attach file or image"}%</a>
      * [[%SCRIPTURL{manage}%/%BASEWEB%/%BASETOPIC%?t=%SERVERTIME{$epoch}%;action=editSettings][%MAKETEXT{"Edit topic preference settings"}%]]
      * [[%SCRIPTURL{oops}%/%BASEWEB%/%BASETOPIC%?template=oopsmore#SetParent][%MAKETEXT{"Set new parent"}%]]
      * <a href='%SCRIPTURLPATH{oops}%/%BASEWEB%/%BASETOPIC%?template=oopsmore&param1=%MAXREV%&param2=%CURRREV%' rel='nofollow' title='Delete or rename this topic; set parent topic; view and compare revisions'>%MAKETEXT{"More topic actions"}%</a>"

-- TWiki:Main/TimotheLitt - 2014-01-15

The Edit pulldown is for actions in the current topic, so the "create new topic" item should not go there.

The TopMenuSkin already has "create new topic" item in the web pulldown, the place where you take action on the current web. The "create new topic" item is omitted in the TWiki web and the Main web because users should not create topics in those webs.

-- TWiki:Main.PeterThoeny - 2014-01-15

For historical reasons, the Main web is used here - more than any other. And the other webs have topics that are created by scripts. So I never saw the Create Topic under 'File' (correction, 'web').

Nonetheless, there is still an issue here.

(I picked 'edit' because the topic is created with the current topic as its parent.)

I guess I could find the test for the Main web and remove it instead. Actually, I think it would it be better to condition the 'create topic' function on whether create topic is permitted for the current user.

Then for new installations the Main web can restrict topic creation to the TWikiAdminGroup (or whatever local policy for other webs).

That would seem to be the general solution. Hardcoding 'protected' webs is neither general nor intuitive. The current omission from the UI doesn't actually protect the web; users who have permissions to create topics are confused. And on other webs, users who don't have permission shouldn't see the option...

For anyone else who follow this:

Currently, it isn't actually a conditional include. Main and TWiki have custom topics defining the 'web' menu that omit the 'Create New Topic' option.

The custom topics are named: /WebTopMenu, and the default for webs that don't have that topic is TWiki/TopMenuSkinDefaultWebTopMenu

The line to add or delete is:

       * <a href='%SCRIPTURLPATH{"view"}%/%BASEWEB%/WebCreateNewTopic?topicparent=%BASETOPIC%' rel='nofollow'>%MAKETEXT{"Create New Topic"}%</a>

But the right answer (for someone with more energy) is to materialize the 'Create New Topic' option if the current user has permission to create a topic in the current web.

-- TWiki:Main.TimotheLitt - 2014-01-15

I disagree on Main web use. A user should be able to create a topic, sometimes in the background on behalf of the user, such as for watchlist topic or personal sidebar. He/she should just be discouraged from creating content in the Main web. Therefore for the Main web it would not make sense to make watchlist dependent on access rights.

Also, making create link dependent of access rights fails if a web is open and the user looks at an access restricted topic.

-- TWiki:Main.PeterThoeny - 2014-01-16

'Discouraged' is amorphous and hard to explain, especially to users who just want to get their job done. Allowed and Prohibited, when enforced, are very clear.

If something is done in the background, on behalf of a user, then the plugin or script that does it should use the bypass permissions flag.

If it's something that the user can do directly, the menu system should allow the action to be found - as the base pattern skin does in its leftbar.

If something shouldn't happen except in extraordinary circumstances, it should be privileged.

As things stand, pattern provides a direct 'create topic' link for Main with the base skin, but with top menu it does not. This is inconsistent.

=Also, making create link dependent of access rights fails if a web is open and the user looks at an access restricted topic. = Not what I meant. To create a topic, you need to have 'change' rights on the web. That's what I'd check. Not the rights of the viewed topic. To control Main, it would be protected denying regular users CHANGE, with the stuff you mentioned done on-behalf of users by a privileged mechanism.

(There may be an issue with CHANGE not being granular enough; creating a topic isn't distinct from editing one.)

Part of the issue with Main is that the rules are not exposed, and the name is misleading.

For the way Main is now intended to work, I think the right thing would be for the create topic page to have a confirmation dialog based on the name of the proposed topic and the user.

I think the rules for Main are something like:

  • If you're in TWikiAdminGroup, you can create any topic. But a warning may be in order.
  • Plugins and scripts can create anything. They're responsible for the correct name/contents, including what templates they use.
  • Any other topic name can't be created (as in the create topic script refuses) by an unprivileged user.
  • Some naming rules need to be created to prevent collisions, perhaps TWiki* for core features, ExtensionName* for pages created/used by ExtensionName, etc.
  • Normal permissions apply to change, rename, delete

Note that we don't want WikiNameWatchlist pages to be created directly by the user. They have a very specific format and should only be created by the plugin on behalf of the user.

{$WikiName}LeftBar} has a specific format, and should be created from a template. Whether the template has some sort of privilege, or the skin provides a script to initialize it is an implementation detail.

There is some engineering to do for a grand solution. But in the meantime, I'd settle for consistency. Base Pattern and TopMenu Pattern should behave the same way.

-- TWiki:Main.TimotheLitt - 2014-01-17

Summary TopMenuSkin missing create topic
ReportedBy TWiki:Main.TimotheLitt

SVN Range TWiki-6.0.1-trunk, Thu, 09 Jan 2014, build 26720
AppliesTo Engine
Component TopMenuSkin
Priority Normal
CurrentState No Action Required


TargetRelease n/a

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r5 - 2014-01-17 - TimotheLitt
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback