Add token for Micro Site ID

Created on 11 July 2023, 12 months ago
Updated 28 September 2023, 9 months ago

Problem/Motivation

A global Token for Micro Site ID is not available. With the ID it would be possible to filter content Tokens in Views Filter Criteria
module based on the current site ID instead of using :name or other tokens, which do not ensure a unique value.

Proposed resolution

In micro_site_token_info add:

  $micro_site['id'] = [
    'name' => t("ID"),
    'description' => t("The ID of the micro site."),
  ];

In micro_site_tokens add:

        case 'id':
          $site_id = $site->id();
          $replacements[$original] = $site_id;
          break;

Remaining tasks

  • Review merge request.
✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΈπŸ‡¦Saudi Arabia martins.bruvelis Thuwal

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024