Review main Abandoned

76534[WIP][FEATURE] Allow additional attribute to access restricted pages

Benni Mack CR 0 V 0 Normal +91 −49 updated 03/17/23, 21:55

Commit message

A new TypoScript option is introduced to allow to set
additional tag attributes to links of pages which are
access restricted but link to a login page.

Example:

Using:
config.typolinkLinkAccessRestrictedPages = 13 (13 is our login page)
config.typolinkLinkAccessRestrictedPages = &originalPage=###PAGE_ID###

generated links which were restricted with a frontend usergroup
to create a link to page 13 instead (the login) page,
with <a href="/login?originalPage=555">My page</a>

The additional property

config.typolinkLinkAccessRestrictedPages.additionalTagAttributes {
  class = access-restricted
  data-unauthorized = true
}

generates
  <a href="/login?pageId=555" class="access-restricted" data-unauthorized="true">My page</a>

This new option is also available to be set for menus via
HMENU.showAccessRestrictedPages = 13
HMENU.showAccessRestrictedPages.additionalTagAttributes.class = access-restricted

Missing: RST

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 4

Review log 47

  1. Benni Mack uploaded patch set 1 11/10/22, 10:38

  2. core-ci voted on patch set 1 V +1 11/10/22, 10:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33453

  3. Benni Mack rebased onto patch set 2 V +1 03/16/23, 22:41

  4. core-ci voted on patch set 2 V +1 03/16/23, 22:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39086

  5. Benni Mack uploaded patch set 3 V +1 03/17/23, 21:43

  6. core-ci voted on patch set 3 V +1 03/17/23, 21:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/39161

  7. Benni Mack abandoned the change 03/17/23, 21:55

    This approach is not good, should be aligned with ATagParams