Skip to content
Snippets Groups Projects

Issue #3521239 Add hook for page visibility of the schema

Closes #3521239

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
schemaapp.api.php 0 → 100644
12
13 /**
14 * Determine if the schema should be added to the page.
15 *
16 * @param array $page
17 * The page array as provided in hook_page_attachments_alter().
18 *
19 * @return int|null
20 * Return -1 to NOT add the schema to the page.
21 * Return NULL will add the schema to the page.
22 */
23 function hook_schemaapp_schema_visibility(array $page): ?int {
24 if (!empty($page['my_special_region']) ||
25 \Drupal::routeMatch()->getRouteName() == 'my_custom_route') {
26 return -1;
27 }
  • Comment on lines +24 to +27

    Wondering your thoughts on making this configurable in the admin panel of the app here so a user could add the hooks they want skip and we could read that and users could dynamically set these values?

  • Please register or sign in to reply
Please register or sign in to reply
Loading