Not all routes set page title in Navigation [RMI24H]
Issue #1285
resolved
cf initial issue #1009. Not all routes added since then support a custom page title.
Note the helper functions in routeHelper
+ /**
+ * Contruct a resolve value for page title for the base route of a feature
+ * ie this is a route with name site.<featureName>
+ * This is set up to create a page Title like
+ * FedEMIS * Schools
+ * @param featureName
+ */
+ public static featureTitle(featureName) {
+ return ["rootPageTitle", (title) => `${title} * ${featureName}`]
+ }
+
+ /**
+ * construct a resolve balue for page title for a page within a fweature
+ * e.g. site.schools.list will return
+ * FedEMIS * Schools: List
+ * @param pageName
+ */
+ public static simpleTitle(pageName) {
+ return ["pageTitle", (title) => `${title} ${pageName}`]
+ }
}
We have from these two common forms:
For e.g. <feature> Lists, <feature> Charts etc
pageTitle: Sw.Utils.RouteHelper.simpleTitle("Dashboard"),
for items:
pageTitle: ['model', 'rootPageTitle', (model, title) => `${title} * Teacher: ${model.tFullName}`]
rootPageTitle
holds the system context name.
rootPageTitle: ["lookupsResolver", "Lookups", (lookupsResolver, lookups: Sw.Lookups.LookupService) => {
+ return lookups.byCode("sysParams", "APP_NAME", "N") || "Pacific EMIS";
+ }],
Comments (5)
-
-
reporter - changed title to Not all routes set page title in Navigation [RMI24H]
-
reporter - changed status to resolved
feat(history): More detailed titles for each page gives richer browser histopry and aids navigation
Resolves:
#1285→ <<cset 840b8c7fa95f>>
-
reporter @Ghislain Hachey Not a high priority but useful to get back into client side development
-
@Brian Lewis Absolutely!
- Log in to comment
Issue
#1203was marked as a duplicate of this issue.