Next: , Previous: Internationalization, Up: Top

7 Top menu and CSS

Every schtonk page shares a common top menu and CSS. Top menu normally includes items like Go to start1, Edit2 etc. This top menu is just plain regular html snippet. Schtonk does not feed it through wiki parser but does substitute some localization items in there. Top menu is normally stored in same table as pages, namely PAGES but with a special pageid ; normal wiki pages have numbers that are positive integers, top menu has number -2. It is not possible to edit top menu with 'normal' edit function, SQL shell to backend database needs to be used. Top menu is fetched from DB only at backend.tcl startup time.

In similar manner as top menu has pageid -2 the common CSS for pages has pageid -1. Schtonk embeds CSS into header of each page so it makes sense to keep it small.

In following text the top menu items are discussed in more details

7.1 Top menu item Go to start

This is just link to page number 0. It may or may not have any special meaning. Out of the box the top menu content looks something like this

     <div id=\"upbar\" class=\"bar\"> <ul>
     <a href=\"/cgi-bin/schtonk/g.tcl?pageid=0?lang=SCHTONK_LANG\">
     <a href=\"/cgi-bin/schtonk/e.tcl?pageid=SCHTONK_PAGEID?lang=SCHTONK_LANG\">
     <a href=\"/cgi-bin/schtonk/h.tcl?pageid=SCHTONK_PAGEID?lang=SCHTONK_LANG\">
     <a href=\"/cgi-bin/schtonk/q.tcl?pageid=SCHTONK_PAGEID?lang=SCHTONK_LANG\">
     <a href=\"/cgi-bin/schtonk/r.tcl?pageid=SCHTONK_PAGEID?lang=SCHTONK_LANG\">
     <hr />

In runtime the text SCHTONK_STR_GO_TO_START gets substituted with a string that is supposed to be found from table STRING_TRANSLATIONS where str_name mathces SCHTONK_STR_GO_TO_START and lang matches the lang=xx snippet from the original URL that user requested. It is just link to g.tcl with pageid 0. See Different g.tcl incarnations. about naming of g.tcl and what it does to schtonk.

7.2 Top menu item Edit

This is link to e.tcl specifying current pageid and lang ; In runtime the SCHTONK_PAGEID and SCHTONK_LANG will get replaced with pageid and language of the current http request and specifying e.tcl as name of the cgi-bin to call causes schtonk to produce a form that has a large textfield containing all text from page for edit purpose.

7.3 Top menu item See history

As a proper wiki, schtonk keeps history of pages ; this is link to g.tcl with name h.tcl and when called with name h.tcl the g.tcl will pass command h to backend.tcl that will then not produce page contents in response but instead a history list of the page.

7.4 Top menu item Attach file

When g.tcl is referenced with name q.tcl it will produce a query that asks for an attachment to be added to page.

7.5 Top menu item Remove attachment

When g.tcl is referenced with name r.tcl it will produce a query that asks for an attachment to be removed from page. Top menu is static so even if there is zero attachments in the page, this link is still here.


[1] link to page 0 that may exist and/or may have some special content like index of other pages

[2] Link that allows user to make a new version of the page