Link to the configuration page is missing in the admin menu

Created on 18 August 2023, over 1 year ago
Updated 25 August 2023, about 1 year ago

Problem/Motivation

The code tells me, that the link (/admin/switch_theme/list) should appear under "system", but it doesn't.

The "configure" link also is not present in the modules list (/admin/modules).
Both works for the Theme Switcher Rules module, probably worth a look?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.2

Component

User interface

Created by

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

Comments & Activities

  • Issue created by @thomas.frobieter
  • 🇫🇷France racol

    Good idea,

    but I didn't want my module to depend on another one but only on Drupal core (easy install, anyway, you know :) ).

    I use it on many of my sites and no dependencies are needed other than Drupal core.

    The simplest solution is often the best :)!

    I will of course think about it but to be honest with you, as long as it works ... ^^, I am interested in other subjects.

    I will focus more on taxonomy search admin form (" https://www.drupal.org/project/taxonomy_search_admin_form "), it seems quite appreciated by the community.

    It goes without saying that I continue to take care of the two modules which are being proofread by ... me. And a "News" module similar to an X (Twitter) or Facebook for Drupal 9|10; finished but not tested on a large scale (only 1000 users on a dedicated server).

    Looking forward to giving you access to the contribution on GIT for:

    - https://git.drupalcode.org/project/taxonomy_search_admin_form
    - https://git.drupalcode.org/project/switch_theme

    pleasure

  • Assigned to racol
  • but I didn't want my module to depend on another one but only on Drupal core (easy install, anyway, you know :) ).

    Ah sorry, this was not the idea. I am pretty happy that it doesn't depend on Theme Switcher Rules, because it does not worked well for my case.

    I just thought its worth looking at its code for the configuration page links to quickly fix this.

    To clearify this, I am talking about the missing settings/"configure" links one the module page and in the admin menu - sorry for the German UI:

    Looking forward to giving you access to the contribution on GIT for:

    I am frontend/theme developer, so I doubt that I am very helpful on the backend coding side :/

  • 🇫🇷France racol

    sorry for the German UI

    Don't worry ;), I added a configuration link (attachment 1.png) in "admin/module" list for the custom module Switch theme. This link redirects to the list of switch theme available (attachment 2.png), what do you think ?

    Furthermore, I haven't tested completely your case of query parameter for the Switch Theme, a release should be available tomorrow :)

    Pleasure

  • Don't worry ;), I added a configuration link (attachment 1.png) in "admin/module" list for the custom module Switch theme. This link redirects to the list of switch theme available (attachment 2.png), what do you think ?

    Perfect!

    Furthermore, I haven't tested completely your case of query parameter for the Switch Theme, a release should be available tomorrow :)

    Sounds Nice! I am happy to test this, just trigger me (:

  • 🇫🇷France racol

    Sorry, I'm late. So I released the version 1.2.0 of Switch Theme including:

    1. Configuration link directly on modules list & Appearance tab
    2. Allowed query parameters in regex theme configuration
    3. Some others corrections on others subjects

    To have it, you must uninstall your current version of the module (1.1.0 I think for 1.2.0). If you have a lot of themes configuration, make sure to make a backup of the regex you writed. Don't worry about your website ;)

    I advise to you to install the module via composer

    composer require 'drupal/switch_theme:^1.2'

    For the query parameters, don't forget to escape the "?" character with a "\" ("?" is a special character for regex, so, if you don't escape it, it will be interpreted), below some examples I used for test:

    1. #^/test\?theme=1$#
    2. #^/test\?theme=7$#
    3. #^/test\?theme=1$|^/test\?theme=7$#

    I created the article "test" with "/test" alias and applied different themes according to the query parameters

    1. #^/test\?theme=1$# => only the theme for the role & regex choosed is applied
    2. #^/test\?theme=7$# => only the theme for the role & regex choosed is applied
    3. #^/test\?theme=1$|^/test\?theme=7$# only the theme for the role & regex choosed is applied
    4. #^/test\?theme=2$|^/test\?theme=3$|#^/test\?theme=4$ ... # the default theme will be applied

    Let me know if this release is good for you ;).

    Pleasure

  • Status changed to Fixed about 1 year ago
  • Awww, so nice!
    I'll test this ASAP, hopefully later this day!

  • It seems that a path still is required, right?

    I am trying to prevent, that the site-admins need to add each new path as rule, so in my case its more like:

    #\?is_embed=1$#
    or simply
    #\?is_embed$#

  • 🇫🇷France racol

    You can use

    #\?is_embed=1$#
    or
    #\?is_embed$#

    In pattern configuration.

    You can also create two switch theme if you want both.

    I tested it on my local env.

    http://rcowebdev.local/?is_embed

    http://rcowebdev.local/?is_embed=1

    Pleasure

  • Yeah, tried that too, but if you have something like:

    https://example.com/my_super_amazing_webform?is_embed

    I don't found a solution yet, but this is very likely (again) about my bad Regex skills -_-

    I really won't waste more of your time, helping me with Regex, our developer is back from holidays in a couple of days, so I better waste HIS time ;)

    Thank you very, very much for the modifications, I really appreciate this!

  • 🇫🇷France racol

    Your regexs are corrects ;)

    Test to reproduce:

    1. Create a page my_super_amazing_webform
    2. URL alias /my_super_amazing_webform
    3. Create Switch theme with #\?is_embed$#
    4. Going to http://rcowebdev.local/my_super_amazing_webform?is_embed, choosen theme applied (attachment is_embed.png)
    5. Going to http://rcowebdev.local/my_super_amazing_webform, default theme applied (attachment not_embed.png)

    Pleasure

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024