Template talk:Clickable button 2

Template-protected edit request on 18 November 2017
ANiMOP (talk) 02:14, 18 November 2017 (UTC) I want to add the necessary colors i did that in the arabic-wikipedia module page
 * Red question icon with gradient background.svg Not done: it's not clear what changes you want to be made. Please mention the specific changes in a "change X to Y" format. —&thinsp;JJMC89&thinsp; (T·C) 08:01, 18 November 2017 (UTC)

Is it possible to create a button that opens the link in a new page?
Hi

Is it possible to create a button the opens the link in a new page? I'm working on something that needs someone to go to another page but I really want to keep the page with button open as well.

Thanks

John Cummings (talk) 09:55, 21 February 2018 (UTC)


 * HTML the target attribute opens links in new tabs or windows.  If this is what you are referring to by "new page", then it is not possible using wikitext. If you want a "Create [input box] article" function, see Extension:InputBox.  — Dispenser 14:00, 10 March 2018 (UTC)


 * Thanks very much . John Cummings (talk) 14:50, 10 March 2018 (UTC)
 * I would also find it very useful to have a parameter that'd allow a button to open a page in a new window. Would there be a way to add such a parameter? Sdkb (talk) 06:09, 11 March 2020 (UTC)
 * It is not possible to specify attributes for link tags. This could be worked around with JavaScript, but honestly browser makers should just improve navigation.  — Dispenser 17:40, 15 March 2020 (UTC)

Allowing same colors on other templates
Would it be possible to add the class parameter for the same colors used in this template to Template:Drop down list? Thanks! Daylen (talk) 04:45, 24 April 2018 (UTC)

Adding images inside buttons?
Is there any way to include images inside of a button? Just trying to insert a file normally breaks it. Sdkb (talk) 17:24, 26 March 2020 (UTC)


 * yes, commons:Template:Clickable button 2 allows adding image with the button. - Vis M (talk) 12:09, 23 June 2021 (UTC)

Small buttons on mobile browsers
Copying from my talk page, has reported that these buttons can show up as very small on their mobile browser. Is this an issue experienced by others, and if so, is there a fix? Sdkb (talk) 17:32, 26 March 2020 (UTC)


 * I see your still trying to push action buttons with no actions to them. The problem is that it's doing the opposite of what your wishing for...60 percent of readers see it as a small mini button that's barely legible..... and is why so many people have accessibility concerns let alone the wrong type of link to go to the next page with no action.-- Moxy 🍁 00:47, 10 March 2020 (UTC)
 * Here is how it displays on my mobile device. I'm not sure what's causing it to display as so small for you or how typical that is, but if it is frequent, that's reason to improve the code at Template:Clickable button 2, as buttons can be a useful tool and appear throughout Wikipedia. Sdkb (talk) 01:15, 10 March 2020 (UTC)

Option for buttons to open in new tab/window, rather than directly?
Is there a parameter that can be used for this, and if not, could one be added? &#123;{u&#124; Sdkb  }&#125;  talk 21:12, 14 June 2020 (UTC)

Fully-protected edit request (TfD)
I'm going WP:BOLD and listing the template at WP:TfD for a merger with with the other clickable button, Template:Clickable button. Could an admin add the TfD notice to it? --littleb2009 (she/her) (talk • contribs) 00:21, 18 June 2021 (UTC)

P.S. Since I don't want anyone to break Wikipedia, remember to use tags!

Deactivating my edit request because an admin answered it at the TfD itslf. --littleb2009 (she/her) (talk • contribs) 23:22, 18 June 2021 (UTC)

ooui buttons
See WMF style guide for buttons and ooui demo.

Also, I feel that the button radius should be increased to 4px. Currently it is 2 px for this template. Earlier it was 4 px and looked better. - Vis M (talk) 12:28, 22 June 2021 (UTC)

Protected edit request on 9 November 2021
Merge with Module:Clickable button 2/sandbox Module:Clickable button 2/sandbox to effect. I have made several changes to the module:
 * Fixing a bug with mw-ui-constructive that would make the text color black ( view here )
 * Adding a new parameter called link that when set to no will result in the button not becoming a link
 * A bit of hacking was involved to fix a certain bug caused when url is set to a link without 1 or 2 being set when no is set).
 * The color from the current Clickable button has been added for backwards compatibility
 * NOTE: How each of these templates handle the former green button differs. That difference has not been resolved here for ease of transition.
 * color only works if class is not set. This is because did not support class. If both are set, then class takes precedence even if the class would not change the button color.
 * While 1 can be set to something like Foobar with the template still functioning, if it contains a pipe there were be unintended results. ( view here )
 * This is one of only major blocks to the current merger but could be solved without using Lua (like regex replacements via WP:AWB)

I worked really hard on this, and I have extensively tested to see if there were any problems. This is a highly visible template, so I half-expecting this request to be denied for procedural reasons (convention tells me these things aren't accepted without serious review). &#8211; MJL &thinsp;‐Talk‐☖ 23:46, 9 November 2021 (UTC) I also added a new class called "clickbutton" just in case we want to do something with that (if the is already going to be there). { &#8211; MJL &thinsp;‐Talk‐☖ 07:04, 11 November 2021 (UTC)
 * Is the desired end result that both templates will use this same code? &mdash; Martin (MSGJ · talk) 18:01, 10 November 2021 (UTC)
 * Yes &#8211; MJL &thinsp;‐Talk‐☖ 19:29, 10 November 2021 (UTC)
 * I see . Would it be more efficient to do  ? &mdash; Martin (MSGJ · talk) 18:18, 10 November 2021 (UTC)
 * Probably, but currently I just have the template wrap span:plainlinks just in case.
 * In the "No link" test, would a blank output be more logical in this case, like the live version does? &mdash; Martin (MSGJ · talk) 18:19, 10 November 2021 (UTC)
 * Oh dear, that result should've been identical to . I need to change that. &#8211; MJL &thinsp;‐Talk‐☖ 19:32, 10 November 2021 (UTC)
 * I've marked this as answered for now and will reopen once that's fixed. &#8211; MJL &thinsp;‐Talk‐☖ 19:33, 10 November 2021 (UTC)
 * In the "URL placed as label" scenario, can/should the square brackets be removed from the output? &mdash; Martin (MSGJ · talk) 18:32, 10 November 2021 (UTC)
 * They should, but I have not been able to think of a solution to that. &#8211; MJL &thinsp;‐Talk‐☖ 19:28, 10 November 2021 (UTC)
 * Thanks for the quick answers. Great job, by the way! &mdash; Martin (MSGJ · talk) 22:11, 10 November 2021 (UTC)
 * Of course! The issue has now been fixed.
 * Looks good. I share the perplexity of commenters in the TfD about why we would ever want a button which is not clickable. Especially a button which changes color when you hover over it, which makes it look clickable. This is not a holdup to implementation but why do we need this feature? &mdash; Martin (MSGJ · talk) 07:56, 11 November 2021 (UTC)
 * It's nice for demonstrative purposes. I actually found out about this merger when I was using clickable button in this thread. &#8211; MJL &thinsp;‐Talk‐☖ 17:59, 11 November 2021 (UTC)
 * ✅. Sorry I forgot about this &mdash; Martin (MSGJ · talk) 12:31, 16 November 2021 (UTC)
 * This edit has caused a problem at Help:Introduction. The buttons there are supposed to take the reader to pages such as Help:Introduction to editing with Wiki Markup/1, but today they have lost the trailing number, jumping to non-existent pages such as Help:Introduction to editing with Wiki Markup/ -- John of Reading (talk) 18:10, 16 November 2021 (UTC)
 * Reverting to Special:Permalink/1055585062 this which removed the valuefunc will fix the issue. I'm going to have to investigate why it that sequence won't pick up anything after a '/'. I'm incredibly sorry about that.. / &#8211; MJL &thinsp;‐Talk‐☖ 18:22, 16 November 2021 (UTC)
 * Fixed now at least thanks to responding quickly.  &#8211; MJL &thinsp;‐Talk‐☖ 18:28, 16 November 2021 (UTC)
 * Fixed now at least thanks to responding quickly.  &#8211; MJL &thinsp;‐Talk‐☖ 18:28, 16 November 2021 (UTC)

Category:Pages using old style ui-button-color is no longer useful
There are two pages left in Category:Pages using old style ui-button-color:


 * Template talk:Clickable button 2/Archive 1
 * MediaWiki talk:Common.js/Archive 20

both of these usages of "old style ui-button-color" are in the discussions about this usage. Also, both discussions mention the category itself. Because there are no more usages of "old style ui-button-color" in the wild, I propose the categorization into this tracking category be removed from Module:Clickable button 2 and the category then can be deleted. —⁠andrybak (talk) 11:53, 8 October 2022 (UTC)


 * @Andrybak, I've made this change, so they should end up removed from the category sometime Soon. Feel free to db-g8 the category whenever it's actually empty. Izno (talk) 08:29, 29 June 2023 (UTC)

Edit Request Module Borked
When a person makes an edit request, due to luaMain being removed, they see "Lua error in Module:Submit_an_edit_request at line 118: attempt to call field 'luaMain' (a nil value)." Because this is being called in Module:Submit_an_edit_request. I'm not sure if this is just part of staging for the move or an unintentional thing, but it seems significant. Sagflaps (talk) 22:51, 23 February 2024 (UTC)
 * Looks like you and Izno took care of the issue; thanks to both. One can only sandbox so much before going live! Primefac (talk) 07:24, 24 February 2024 (UTC)

Edit request 24 February 2024
Description of suggested change: Please revert this edit

Reason: This change seems to have broken system messages which invite users to submit edit requests (Module:Submit an edit request depends on Module:Clickable button 2). See Template:Submit an edit request for an example of the Lua error that is getting displayed when someone views the source of a page they don't have the necessary permissions to edit. pinging for your info. All the best, &zwj;—&zwj;a smart kitten[ meow] 01:03, 24 February 2024 (UTC)


 * I'd advise you to withdraw this, as there's a edit request that should unbreak this without reverting a huge edit at Template talk:Submit an edit request. Queen of Hearts (talk • stalk • she/they) 01:18, 24 February 2024 (UTC)
 * @Queen of Hearts: I'm torn - on the one hand, the other edit request will (hopefully) fix things with just a small change. On the other hand, part of me thinks it might be better to revert the change in this module (to the last known stable version) as a precaution, given the issue that's been noticed as a result of it. As my understanding of Lua is fairly limited, I don't have the technical knowledge to be able to understand all of the changes made in the most recent edit to this module myself - therefore, part of me thinks it might be better to leave this request open, and leave it to the responding admin to decide which edit to implement. All the best, &zwj;—&zwj;a smart kitten[ meow] 01:33, 24 February 2024 (UTC)
 * Red information icon with gradient background.svg Not done: I took care of the other one and would hate for someone else to process this one. I will check to see if there are other uses of the module. Izno (talk) 01:53, 24 February 2024 (UTC)