Project:Support desk

About this board

Welcome to the MediaWiki Support desk, where you can ask MediaWiki questions!

(Read this message in a different language)

See also

Other places to ask for help:

Before you post

Post a new question

  1. To help us answer your questions, please indicate which versions you are using, as found on your wiki's Special:Version page:
    • MediaWiki version
    • PHP version
    • Database type and version
  2. Please include the web address (URL) to your wiki if possible. It's often easier for us to identify the source of the problem if we can see the error directly.
  3. To start a new thread, click "Start a new topic".

How to disable edit for administration only

1
Thatnewman (talkcontribs)

Hello i would like to Set protections on all My Templates and Modules for administration only.... IS there a way to do that once?

Reply to "How to disable edit for administration only"

Filters Not Applying to RSS Feed

3
PlasmoidThunder (talkcontribs)

I've recently started using an RSS bot in our wiki's Discord server to log recent changes to a channel, but ran into an issue where some filters specified in Recent Changes don't affect the feed. Despite hidenewpages=1 and hidelog=1 functioning as intended on the Recent Changes page, they don't remove new pages and move/deletion/block logs from the raw feed. I am aware of extensions that add more dedicated activity feeds to a server, but I do not have control over what extensions get installed so they aren't an option.

Currently I've had to specify filters on the bot's side, but since it's filtering by what's in the <description> tags, as that's the best I can do, an edit summary containing the filtered phrases will prevent that change from being posted by the bot, which is obviously not desirable.

For the record, the namespace filter does affect the feed, so surely other filters not doing so is unintentional behaviour, right? This can be observed on any wiki's Recent Changes page, including this one.

Bawolff (talkcontribs)
PlasmoidThunder (talkcontribs)

That's really unfortunate. Hopefully they update this.

Reply to "Filters Not Applying to RSS Feed"
Fusionoz (talkcontribs)
Reply to "Images not displaying"

find every <file> or </file> and replace

2
JanTappenbeck (talkcontribs)

hi!

a old function did not work. so i create a new template.

is there a simple way to change in <file> => {{File| and </file> => }} in the hole database?

regards Jan

Jonathan3 (talkcontribs)

I think Extension:Replace Text could do that.

I've not tested this, but if you use the regex setting you could find

<file>(.*)<\/file>

and replace it with

{{file|$1}}
Reply to "find every <file> or </file> and replace"

Apply css only for search results page

1
Summary by Spiros71

I found it, I just need to target .page-Special_Search

Spiros71 (talkcontribs)

I want to remove the sidebar and expand the search results content on this site with something like this:

#mw-site-navigation, #mw-related-navigation, #page-tools {
    display: none;
}
#mw-content {
    margin-left: 0em;
    overflow: unset;

}

Is it possible to target these changes only for the search results pages, i.e. pages with index.php?search=

Broken custom toggle JavaScript

1
AtomicMario (talkcontribs)

Hello. I'm an interface admin on Encyclopædia Dramatica (where I go by "MarioMario456"). The wiki has this JavaScript that extends the MediaWiki custom toggle by allowing a toggle button with expand/collapse text anywhere (this is used on series templates). However, sometimes it doesn't work:

$(document).ready(function() {
	$(".collapsibletoggletext").click(function() {
		$(this).parent().children(".collapsibletoggletext").removeClass("hiddentext");
		$(this).addClass("hiddentext");
	});
});

For those JavaScript-illiterate, it's: When the page has loaded, when an object with the class "collapsibletoggletext" is clicked, all other objects with the class "collapsibletoggletext" in the parent have the class "hiddentext" (which has the CSS "display:none", meaning it's hidden) removed, while the "collapsibletoggletext" that was clicked has the "hiddentext" class added.

Here's an example:

[<span class="mw-customtoggle-example collapsibletoggle showhidetext"><span class="collapsibletoggletext hiddentext">Collapse</span><span class="collapsibletoggletext">Expand</span></span>]
<div id="mw-customcollapsible-example" class="mw-collapsible mw-collapsed">Hello World!</div>
Reply to "Broken custom toggle JavaScript"

how to add "in other languages" section in the sidebar?

9
2409:8928:430:53EC:98F:4D5F:1790:A842 (talkcontribs)

Hi team, I just a new user for mediawiki. And I just start up mediawiki system in a linux server. And it can be access, but seems can't find "in other languages" section in the sidebar on the left side of the page. Please let me know if there is something I missed, thanks!

Malyacko (talkcontribs)

On Wikimedia wikis, this is provided by the Wikidata extension and relies on Wikidata. Please elaborate on your use cases and underlying problems you want to solve.

ChenjingJiang (talkcontribs)

Hi Malyacko, could you provide the extension page link? thanks! I can't find the extension you mentioned.

Bawolff (talkcontribs)

Extension:Wikibase


There is also an older system built into core that requires less setup - interwiki links that have the language code as the link name help:interwiki

2409:8928:4B6:480A:C946:DF91:871A:6071 (talkcontribs)

Hi Bawolf, I've installed Wikibase extension, and also can find the "in other languages" section. However, it seems need to install other extensions to support multi languages wiki site? could you please provide the extension link for that can enable multi languages wiki site? many thanks!

Bawolff (talkcontribs)

Wikibase is complicated (although no other exts are required afaik. You do have to setup 2 wikis for it).

If just starting out i would reccomend just starting with interlanguage interwiki links.

ChenjingJiang (talkcontribs)

Hi Bawolff, I just practiced interwiki links, and now we want to setup 2 wikis for wikibase, but I just have no idea about how to setup 2 wikis and how to combine them together? please help to show me the way. Thanks!

ChenjingJiang (talkcontribs)

hi Bawolff, Many thanks!

ChenjingJiang (talkcontribs)

Thanks for your answer! I will research the Wikidata extension, thanks!

Reply to "how to add "in other languages" section in the sidebar?"
Thatnewman (talkcontribs)

How do i remove the dash Before my name... On google it is like this

- Website

instead of

Website

even on browser top.....


How do i remove the dash

Jonathan3 (talkcontribs)

Maybe edit Mediawiki:Pagetitle.

Malyacko (talkcontribs)

Apart from that: If something only happened on Google, then you need to talk to Google.

Samwilson (talkcontribs)

@Thatnewman: : this dash is normally used to separate the page title and the wiki title. Do you want to get rid of the wiki title completely, or just not have a dash between them? As Jonathan3 says, you can edit Mediawiki:Pagetitle, or if you want extra control over the title on a page-by-page basis, the WikiSEO extension can be pretty good.

Reply to "Remove Dash - from name"

How to force line breaks? Plugin, Extension?

3
Shaztopia (talkcontribs)

Hi everyone,


My wiki is located at https://www.gamecollecting.io/wiki/Main_Page and I wanted to see if there was a way I could force the wiki to acknowledge line breaks like how it shows in the editor. Another wiki I commonly edit on here can do it! Here: https://tcrf.net/Rogue_Galaxy

However I just cannot figure it out. Do I need an extension? Do I need to add my own code to the wiki?

Jonathan3 (talkcontribs)

If it's just the occasional thing you could use the Poem extension. I don't know how you'd do it site-wide.

Bawolff (talkcontribs)

check out the white-space css directive.

Reply to "How to force line breaks? Plugin, Extension?"

API - How to do bullet points

2
Desbrina1 (talkcontribs)

I'm having trouble trying to do bullet points using the API, I can't work out how to get it to do the new line, everything ends up on the same line.


I've tried using

$maps[] = "* " . $mapName . "<br/>";

$maps[] = "* " . $mapName . "\n";

$maps[] = "* " . $mapName . "\r\n";


None of which work

Bawolff (talkcontribs)

Please show full code.

Reply to "API - How to do bullet points"