This template (like all templates) is within the scope of WikiProject Templates, a group dedicated to improving the maintenance of Wikipedia's templates. This particular template is especially important to the project because it is used in the maintenance of other templates. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.TemplatesWikipedia:WikiProject TemplatesTemplate:WikiProject TemplatesTemplates
You should wrap the link around the button. Otherwise parts of the area won't direct the user to the target, which can be very confusing. -- Rillke (talk) 12:11, 9 September 2012 (UTC)[reply]
The template accepts a piped link in one parameter:
If it's called with a piped link then I don't know a way to wrap the link around the button and display the link text inside. If the link target and text were in separate parameters then the system at Wikipedia:Teahouse/Questions#Clickable button (permanent link) could be used. Here are fully clickable buttons formatted with a url in the first and a wikilink in the second:
It depends what is wanted from the template. It works with one page name, or two page names as separate parameters. It doesn't work for a piped link in one parameter, or an external link in one or two parameters:
{{User:Vanischenu/sandbox|[http://en.wikipedia.orghttps://demo.azizisearch.com/lite/wikipedia/page/Talk:Main_Page Main page talk page]}} ---> Kaniyambetta is in Kalpetta State Assembly constituency. Its coordinates is 11°42'N, 76°6'E, 11°42'22.00"N, 76°6'3.67"E
{{User:Vanischenu/sandbox|http://en.wikipedia.orghttps://demo.azizisearch.com/lite/wikipedia/page/Talk:Main_Page|Main page talk page}} ---> Kaniyambetta is in Kalpetta State Assembly constituency. Its coordinates is 11°42'N, 76°6'E, 11°42'22.00"N, 76°6'3.67"E
{{Clickable button|[http://en.wikipedia.orghttps://demo.azizisearch.com/lite/wikipedia/page/Talk:Main_Page Main page talk page]}} ---> Main page talk page
I don't know a way to make those two work for a fully clickable button. The third could be made to work if the template is told (or can figure out) whether the first parameter is a url or a page name. PrimeHunter (talk) 15:40, 11 October 2012 (UTC)[reply]
My response follows your enquiry. Yes, you'll have to use 2 params which would break backward compatibility if you use unnamed params. And it should also support external URLs. Therefore I made some more complicate stuff at commons:Template:Clickable button (from the beginning on). Nice idea this template. Before I used the raw HTML markup but it looked always messy. Thx -- Rillke (talk) 15:42, 11 October 2012 (UTC)[reply]
Support the semantic button styles (mw-ui-{progressive,destructive})
Hey, thanks for using mw:Agora styles! By design this default Neutral button style doesn't stand out, so that you can have
ThisThatSomething elseDo it
and have [Do it] as the "Call to action". So maybe the template could support a parameter for the additional semantics. Someone could and should update templates like {{Blue button}}, but the semantic styles are more future-proof. The underlying CSS styles are in a living style guide. -- S Page (WMF) (talk) 23:38, 3 July 2014 (UTC)[reply]
Could this button be rewritten into OOjs UI style, which is supposed to replace old and unmaintained MediaWiki UI? E.g. cswiki already made the change. There is a nice conversation between me and mediawiki dev MatmaRex, where I found out MWUI is deprecated and there is a new OOUI (classes oo-ui-*) instead, which is intended to replace that old MWUI (classes mw-ui-*) and oldest UI (classes ui-*). --Dvorapa (talk) 09:12, 21 November 2015 (UTC)[reply]
@Luky001: In [1] you changed it completely from being a translation of our template. Why did you change it and where did you get all that code? I don't want to track which of all those oo-ui classes does what in desktop versus mobile. PrimeHunter (talk) 11:21, 28 March 2019 (UTC)[reply]
@PrimeHunter: Hi, I took it from Czech Wikipedia because it seemed to me more understandable and thererefore easier to translate into Slovak. I was already solving the issue that the button was working in "Show preview" while editing but normally was displaying just as normal text with a hyperlink. After adding this code to sk:MediaWiki:Common.js it is working on the web.
I was told that this same code should make template work for mobile versions when added to sk:MediaWiki:Mobile.js, but the user is not sure if it is going to work, so he advised me rather to do some simpler version in sk:MediaWiki:Mobile.css. Note: Template is not working in mobile view on Czech Wikipedia as well. --Luky001 (talk) 16:53, 28 March 2019 (UTC)[reply]
@PrimeHunter: For me it doesn't work in Firefox. But the question is how you make it work in mobile view here at English Wikipedia. Is it somewhere in the code of the template or are there any outer conditions affecting it? --Luky001 (talk) 21:57, 28 March 2019 (UTC)[reply]
@Luky001: The outer conditions are present in MediaWiki and don't require anything in the wiki. Special:ExpandTemplates shows that
@PrimeHunter: That I know and I used this code before having this template. Still, with this template I find it more easy to change the type and size and what is the most important, when having URL link in this code, it will show there the icon of hyperlink, which doesn't look nice when having a button. This template solves these things. --Luky001 (talk) 22:36, 28 March 2019 (UTC)[reply]
{{Clickable button}} creates a clickable button in the first place (without a function by default, can be misleading), {{Clickable button 2}} always creates a link styled like a button
{{Clickable button 2}} is done through Lua Module (more elegant solution)
{{Clickable button 2}} has a parameter for URLs, no need to wrap in a wikilink, better handling of links (in my opinion)
Example internal link: [[Main Page | {{Clickable button| Main Page}} ]] → [[Main Page | Main Page ]] and some additional text vs.{{Clickable button 2|Main Page}} → Main Pageand some additional text
Example external link: {{Clickable button|url=https://en.wikipedia.orghttps://demo.azizisearch.com/lite/wikipedia/page/Main_Page | External link}} → External linkand some additional text (notice: there is no blank space after the link icon!) or {{Clickable button|[https://en.wikipedia.orghttps://demo.azizisearch.com/lite/wikipedia/page/Main_Page External link]}} → External linkand some additional text (notice: now the link text is styled as normal wiki link!) vs.{{Clickable button 2|External link|url=https://en.wikipedia.orghttps://demo.azizisearch.com/lite/wikipedia/page/Main_Page}} → External linkand some additional text
This edit request has been answered. Set the |answered= parameter to no to reactivate your request.
Add the following to the top of the page:
<noinclude>{{For|the more commonly used clickable button|Template:Clickable button 2}}</noinclude>
This might help people delving into buttons for the first time more easily figure out where to go. As always, make sure the </noinclude> ends on the same line as the first line of the template code. {{u|Sdkb}}talk17:30, 17 June 2020 (UTC)[reply]
After your changes, the colour of the link has changed from blue to black. I think I prefer the blue, as we use that throughout Wikipedia. — Martin (MSGJ · talk) 10:37, 6 March 2024 (UTC)[reply]
Hmm. That's a fairly significant change and I think it's reasonable to ask where this was discussed, as I couldn't find this aspect came up in the 2021 TfD at all. I guess it's not the end of the world, but what would be the CSS needed to turn it back to blue? — Martin (MSGJ · talk) 13:30, 7 March 2024 (UTC)[reply]
Clickable button 2 never had bluelinks, and CB1 wasn't supposed to be linked in the first place (people found a hack to get wikilinks in it). Primefac (talk) 14:51, 7 March 2024 (UTC)[reply]
The <small>...</small> issue has been dealt with, and I don't see any other tags that would be borking things, so I'm going to re-implement the merge. Primefac (talk) 21:17, 6 March 2024 (UTC)[reply]
The small issue came up again today for some reason.
{{clickable button|<small>[[Wikipedia:WikiProject Women in Red/Ideas|Ideas]]</small>}} produces [[Wikipedia:WikiProject Women in Red/Ideas|Ideas]] — Martin (MSGJ · talk) 05:01, 21 March 2024 (UTC)[reply]
I did, but I thought you had fixed the module so that small would not faze it? I'm worried there will be others will small in them. — Martin (MSGJ · talk) 09:58, 21 March 2024 (UTC)[reply]
Okay that's reassuring. But what I don't understand is that "small" was there for at least a month and it was definitely displaying correctly until recently. And I couldn't see any recent edits to the module. — Martin (MSGJ · talk) 10:35, 21 March 2024 (UTC)[reply]
The CSS class mw-ui-constructive was removed in phab:T146923, phab:T155203, and other related tickets. Using this CSS class doesn't change a {{clickable button}} visually anymore:
no CSS classclass=mw-ui-constructive
Should something be done with the existing support for it in the module? See lines 100–102 and line 132.
Probably good to remove ghosts in the code to avoid compounded errors down the road. It should be as simple as removing those lines but I'll have to take some time to make sure of that first. Primefac (talk) 13:46, 17 May 2025 (UTC)[reply]