Fossil Forum

Proposed patch to remove Wiki help link on home page
Login

Proposed patch to remove Wiki help link on home page

Proposed patch to remove Wiki help link on home page

(1) By Kevin (kevgrig) on 2021-07-02 20:14:45 [source]

Hi, I'm enjoying Fossil for a new page I'm building; thank you.

One minor aesthetic annoyance is that, by default, a wiki page as a homepage shows a "Help" sub menu item. This is the only sub menu link on the home page so it adds an additional link row and I just personally think it doesn't look good as it's not a common use case for a user to ask for help about how to edit wiki pages from the home page. I have a screenshot but I don't know if it's common practice or not to attach images to forum posts.

Below is a proposed patch to avoid this just for the homepage. I mailed in a signed contributor agreement this past Monday.

Index: src/wiki.c
==================================================================
--- src/wiki.c
+++ src/wiki.c
@@ -538,11 +538,11 @@
 */
 void wiki_page(void){
   char *zTag;
   int rid = 0;
   int isSandbox;
-  unsigned submenuFlags = W_HELP;
+  unsigned submenuFlags = g.isHome ? 0 : W_HELP;
   Blob wiki;
   Manifest *pWiki = 0;
   const char *zPageName;
   const char *zMimetype = 0;
   int isPopup = P("popup")!=0;

(2) By Richard Hipp (drh) on 2021-07-02 20:28:27 in reply to 1 [link] [source]

Do I understand correctly that you have put "/wiki?name=Home" or similar in the "Index Page" setting of the Setup→Configuration menu? If so, then perhap just add the "nsm" query parammeter:

/wiki?name=Home&nsm

See the /wiki help for more info about the "nsm" query parameter.

Or, is your setup somehow different such that you do not have the opportunity to specify the "nsm" query parameter?

(3.1) By John Rouillard (rouilj) on 2021-07-03 01:23:57 edited from 3.0 in reply to 2 [link] [source]

Hmm, I have the same issue. My home page is defined using the Index Page setting on /setup_config. My Index Page value is /home. Changing that to /home?nsm results in an infinite redirect. In the comments for Index Page it says:

Note: To avoid a redirect loop or other problems, this entry must begin
with "/" and it must specify a valid page. For example, "/home" will
work but "home" will not, since it omits the leading "/".

Apparently query params also cause a redirect loop.

Manually changing /home to /home?nsm in the address bar of the browser does suppress the submenu as desired.

-- rouilj

(4) By Warren Young (wyoung) on 2021-07-03 06:51:35 in reply to 3.1 [link] [source]

You need to use an explicit /wiki link for this, not /home.

Ideally, setting the home page to /home?nsm would work, implicitly referencing the wiki doc by the project name, but I've confirmed your symptom: doing so causes a redirect loop.

(6) By Kevin (kevgrig) on 2021-07-05 16:38:51 in reply to 2 [link] [source]

Apologies for my slow response.

Do I understand correctly that you have put "/wiki?name=Home" or similar in the "Index Page" setting of the Setup→Configuration menu?

It's set to /home which I think is the default.

perhap just add the "nsm" query parammeter

Setting it to /home?nsm caused an "The page isn’t redirecting properly" error.

Setting it to /wiki?name=${PROJECT_NAME}&nsm works but I think such a URL when going to the home page is even less aesthetically pleasing.

(5) By Stephan Beal (stephan) on 2021-07-03 07:08:29 in reply to 1 [link] [source]

One minor aesthetic annoyance is that, by default, a wiki page as a homepage shows a "Help" sub menu item.

That particular menu entry is not so much for help, but is a gateway to the rest of the wiki functionality and docs: page list, recent edits, editor, syntax rules, etc.

Perhaps "Help" simply needs to be renamed to... to... suggestions welcomed.

(7) By Kevin (kevgrig) on 2021-07-05 16:41:58 in reply to 5 [link] [source]

Perhaps "Help" simply needs to be renamed

I see your point as it has more than help topics but I can't think of a word that covers all of the links, so it seems reasonable as is.

(8) By graham on 2021-07-05 17:38:47 in reply to 5 [link] [source]

Perhaps "Manage" or "Manage Wiki"?