allow multiple labels setting for breadcrum#253
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0660f1df17
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { | ||
| uri: parent, | ||
| label: label, | ||
| label: breadcrumb_label(data_parent, template, label_prop), |
There was a problem hiding this comment.
Apply label fallback list to the current breadcrumb
This routes only parent breadcrumbs through the new fallback-list helper; the active/current item is still built in build_breadcrumbs with the old scalar lookup (data[@config[:breadcrumbs].first["label"]]), so when label is an array that lookup misses and a page such as ex:sect1 renders the default title Section 1 instead of the configured fallback Sect1. Please use the same fallback helper for the depth-0 label so the new option applies to every breadcrumb item.
Useful? React with 👍 / 👎.
Summary
Support both a single property and a list of properties in the breadcrumb
labelconfiguration.When multiple label properties are configured, ttl2html now checks them in order and uses the first property that has a value. If none of the configured properties match, it falls back to the default title generated by get_title.
This keeps the existing behavior for a single label property while allowing projects to define prioritized fallback properties for breadcrumb labels.
Types of changes