XF 2.2 Remove style switch confirmation

Rodagave

Member
Greetings. I've been searching for a way to remove the confirmation message that is shown to a user when they try to change from one style to the other by the use of a button on the forums. Is there any way to remove this confirmation message, therefore making the style switch instant?

Thank you beforehand.
 
What do you exactly mean with "confirmation message"? Is there a flash message? 🤔

Can you post a screenshot?

If you want to place a link to choose a specific style you can use a code like this in your template:

HTML:
<a href="{{ link('misc/style', null, {
                                            'style_id': 1,
                                            't': csrf_token()
    }) }}"
    rel="nofollow">
    New style
</a>

(replace 1 with desired style id)
 
What do you exactly mean with "confirmation message"? Is there a flash message? 🤔

Can you post a screenshot?

If you want to place a link to choose a specific style you can use a code like this in your template:

HTML:
<a href="{{ link('misc/style', null, {
                                            'style_id': 1,
                                            't': csrf_token()
    }) }}"
    rel="nofollow">
    New style
</a>

(replace 1 with desired style id)
Hey there, thanks for your response. Here is an image of what I meant by "Confirmation". Every time someone attempts to change their style from Light to Dark, or vice versa, they are prompted with this. And I have noticed that some browsers do not show you this screen.
 

Attachments

  • Screenshot_1.webp
    Screenshot_1.webp
    7.2 KB · Views: 7
o.k. so you are not using the default style chooser link in the footer (like here on XF.com), but a direkt link like this with a style_id as parameter, like so:


If you add the csrf_token to the link (see above), you won't see the confirmation link anymore.
 
o.k. so you are not using the default style chooser link in the footer (like here on XF.com), but a direkt link like this with a style_id as parameter, like so:


If you add the csrf_token to the link (see above), you won't see the confirmation link anymore.
Oh, interesting. It is no longer asking for confirmation. Thank you nocte, I appreciate it.
 
Top Bottom