Pages and routing

A page is a menu entry: a record of BSPK_WEB_DOMAIN_MENU, itself attached to a BSPK_WEB_DOMAIN. Blocks point at it through webDomainMenuUuid.

The fields that decide whether a URL answers

The page table has 25 fields. These are the ones that matter when a page does not respond:

FieldEffect
publishFalse gives a 404. Not a hidden page: a missing one
publishStart / publishEndTime-boxing, enforced on the page itself
urlPartsThe URL segments
useName / useNameAsPrefixWhether the name takes part in building the URL
autoUpdateWhether the URL is regenerated when the name changes
displayInMenuMenu only. Has no effect on whether the URL answers
isHomepageThe domain's entry point
tableNameThe table a detail page binds to
userRightUuid / editRightUuidWho may view, who may edit

Trap: displayInMenu and the visibility rules drive the MENU, not the service. A page absent from the menu is still served to anyone with its URL. To actually close it, use the rights or unpublish it.

Creating a page through the API

Two failures, both frequent:

  • publish: true is mandatory, otherwise every request returns a 404. Once published, the route answers without needing a restart.
  • urlParts, useName and autoUpdate must be consistent. A page created without them has no usable URL and returns a 404 even though the record exists.

Regenerating a URL is a silent no-op when autoUpdate is false: the name changes, the URL does not, and nothing says so.

Dynamic pages

A page bound to a table takes the record's key in the URL. Two rules:

  • ?pk= is reserved by the router. Never use that parameter name for your own purposes.
  • In 4D, the key of the current record arrives as $vo_POST.pk.

The breadcrumb label follows a cascade: the expression (pageLabelExpression), then a URL parameter, then the page name.

Multilingual pages

languageOptions and the alternate-page link carry the equivalence between language versions. A language equivalence redirects with a 301, not a 302: the move is permanent, and search engines should forget the old URL.

Domain-level switches

BSPK_WEB_DOMAIN decides what the pages get: templateType (which page shell: tpl-page1, tpl-page2…), useSpa, useWebSocket, useWebApp, analytics tags, and loginPageUuid.

Admin screens

The /bweb/* screens follow the same model but are rendered from stored templates. Two things that bite:

  • access is by an ADMIN_<SLUG> right, not a hard-coded DEV code;
  • the standard modal block does not work there (see Modal).

See also