Fossil

Timeline
Login

Timeline

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Submenu parametric links

Submenu parametric link (or SMPL for short) is a lightweight method to add a few custom hyperlinks into the submenu of some pages.

SMPLs are "request-local": their existence and values are derived from the special parameters in the request's query string. The names of the query's parameters that are investigated and acted upon are formed by concatenation of the page-specific prefix and suffix "smplXY", where optional ending XY may vary (as explained below).

For the time of this writing, only /rptview and /wiki pages support SMPLs. /rptview pages recognize and respond to the query parameters named "rvsmplXY", /wiki pages - to the query parameters named "wikismplXY".

In all cases, an optional ending XY consists of a digit X from the set {1,2,3,4,5} and an optional letter Y which (if present) must be either 'a' or 's' (which are short for "alias" and "skin" respectively). This variance enables to request several SMPLs "within" a single page. It is suggested that parameters within URL aliases end with letter 'a' and parameters within custom skins' headers/footers end with letter 's'. Parameters without Y are suggested for the general use within the regular content of a repository.

The target of the hyperlink is always local to the repository: it is formed by concatenation of a repository's base URL with the value of the recognized parameter. Parameter's value is well-formed if its first filepath segment (separated by the first '/') has no strange characters (i.e. only alphanumeric ASCII characters, dashes and the underscores '_' are allowed). Parameters that have malformed values are silently ignored.

The text (label) on the resulting submenu element equals to the value of the parameter modulus some prettification for better UX:

  1. If a parameter's value starts with a lowercase letter and contains '/' then it goes unchanged into the user-visible label.

    • If the first letter is uppercase then the label is truncated at the first '/' (if any),
    • otherwise the first letter is capitalized.
  2. Underscores in the first path segment are replaced with spaces.

  3. If the resulting label starts with an uppercase letter then it is prepended with "✧" symbol for explicit distinction from the built-in labels.

See also

25 check-ins related to "rptview-submenu-paralink"
2022-02-10
00:22
Merge from trunk ... (Leaf check-in: a961a67b user: george tags: rptview-submenu-paralink)
00:05
Remove unused local variable from cgi_parse_POST_JSON() to fix a compiler warning. ... (check-in: 96bf76a4 user: george tags: trunk)
2022-01-21
20:24
Merge from trunk ... (check-in: 9094def2 user: george tags: rptview-submenu-paralink)
11:38
Fix the previous check-in to list environment variables used by the CGI Server Extensions feature in the correct place. ... (check-in: 6eeb7ec1 user: florian tags: trunk)
2021-10-09
20:05
Merge in trunk (release 2.17) ... (check-in: a33f616e user: george tags: rptview-submenu-paralink)
14:43
Version 2.17 ... (check-in: f48180f2 user: drh tags: trunk, release, version-2.17)
2021-08-15
23:49
Merge from trunk ... (check-in: 59010c7c user: george tags: rptview-submenu-paralink)
18:38
Remove a harmless unused variable. ... (check-in: a004b172 user: drh tags: trunk)
2021-06-15
22:31
Do not allow links with "../" substring or '<' character. The former enforces that the link maps into a repo-local page; the later enforces defense against injection of malicious HTML elements. ... (check-in: 6261c94b user: george tags: rptview-submenu-paralink)
21:45
Merge from trunk ... (check-in: f4458559 user: george tags: rptview-submenu-paralink)
17:20
Factored out an extraneous var from [1bb06c94]. No functional changes. ... (check-in: e0686dda user: stephan tags: trunk)
2021-06-12
18:43
Add support for submenu parametric hyperlinks for /rptview and /wiki pages. ... (Closed-Leaf check-in: 9690fc39 user: george tags: not-allowed.)
17:28
Add a note to the Changelog. No code changes. ... (check-in: 528d6289 user: george tags: rptview-submenu-paralink)
2021-06-08
01:04
Merge from trunk ... (check-in: 9712d59d user: george tags: rptview-submenu-paralink)
2021-06-07
17:48
Include the login-group in the repository list of "fossil all ui". ... (check-in: fe178faa user: drh tags: trunk)
2021-05-25
16:14
Split recognizable names of query parameters into three groups: 1) "...smplX" for the common use within user content 2) "...smplXa" that is provisioned to be used in aliases; 3) "...smplXs" that is provisioned to be used in custom skins. In all three groups X is a digit from {1,2,3,4,5}. ... (check-in: 588b3765 user: george tags: rptview-submenu-paralink)
2021-04-14
18:48
If a parameter's value starts with an uppercase letter then truncate resulting label to just the first path segment. This check-in also adds a few code-comments related to %s formatting. ... (check-in: b75ee4f2 user: george tags: rptview-submenu-paralink)
2021-04-09
04:21
Remove useless 'nMaxDigit' parameter from the signature of the style_submenu_parametric(). Also edit a corresponding comment. ... (check-in: d1651e7e user: george tags: rptview-submenu-paralink)
02:58
Use "Reports" for the /reportlist element, as per [1a1c0ebe3cf9]. Also be more pedantic when composing user-visible labels for the parameter-induced hyperlinks. ... (check-in: 8861a68e user: george tags: rptview-submenu-paralink)
2021-03-26
18:25
Integrate rptview-submenu-paralinks branch. For this check-in parametric links in submenus are enabled on /rptview page (may be triggered by rvsmpl, rvsmplX, rptview_smpl, rptview_smplX parameter names) and also for /wiki page (may be triggered by wikismpl, wikismplX parameter names). See also forum threads 612170e310 and 8cc4931e69. ... (check-in: 5c5aa19c user: george tags: trunk)
17:59
Merge-in changes from trunk (~ version 2.15) ... (check-in: 29067107 user: george tags: rptview-submenu-paralink)
17:28
Update the change log and index page with the new release information. ... (check-in: 97610f82 user: drh tags: trunk)
17:20
Allow a page's submenu to have multiple parametric hyperlinks induced by several different query string parameters. Use a common suffixes (smpl,smpl1,...smpl9) to probe for defined parameters. Relax constraints on hyperlink values to allow linking to wiki pages (for example). As a proof of concept add support of paralinks to the /wiki page. Get rid of dangling '&' at the endings. ... (check-in: d075801a user: george tags: rptview-submenu-paralink)
2021-03-25
04:11
At /rptview page show link to /reportslist. If request's query string contains rvsmpl parameter then also show an auxiliary link to the page defined by the value of this parameter. Labels and links rendered via %s format specifier because %h and %T did not work properly. In this particular case this seems fine because style_finish_page() renders HTML via %h(...). Code review is very welcome though. ... (check-in: b982c001 user: george tags: rptview-submenu-paralink)
2021-03-24
15:40
Update the form spider protections so that links to /register go through even if spider protection is fully enabled. This allows self-registration even if user "nobody" has no permissions. ... (check-in: 89b724dc user: drh tags: trunk)