8 votes
Accepted

How do you hot link an external image from a Media Wiki site?

Your example [http://example.com/image.jpg] is correct. You will need to enable this by setting $wgAllowExternalImages to true in your configuration file. The default is false. Optionally, you can ...
user avatar
  • 32.5k
7 votes

What is a "data-ad-slot" for Google Adsense and why is inline styling required?

When you create an Adsense ad, you can select it to be either responsive or fixed size. If it's a fixed size, you'll get the sizing thrown into the ad as part of the styling: style="display:inline-...
user avatar
6 votes
Accepted

In MediaWiki, how to make a template that will not display anything when variable is null?

Assuming you have the ParserFunctions extension, you can use the #if function, as documented on MediaWiki: This function evaluates a test string and determines whether or not it is empty. A test ...
user avatar
6 votes
Accepted

Why can't update.php connect to my database when my site connects to it just fine?

I seem to have resolved this by explicitly adding the socket to the $wgDBserver variable in LocalSettings.php. To get the socket path, I ran this query in my SQL database manager: show variables like '...
user avatar
5 votes
Accepted

Expunge deleted version of uploaded file

Your question is unclear, and appears to be based on several misunderstandings of how the software works. Assuming I'm guessing correctly: You have a website running the MediaWiki software, and this ...
user avatar
  • 236
5 votes
Accepted

Can a very large not-so-relevant sitemap hurt my site to Google’s eyes?

You generally won't want these excess pages in your sitemap. The sitemap should only contain links to URLs you actually indexed & listed by search engines. If you have property/form URLs in your ...
user avatar
  • 5,794
5 votes

File system permission for MediaWiki?

The following picks up on a fresh working LAMP installation under Red Hat 7 or clone (CentOS 7, Scientific Linux 7, Orcale 7, etc). Set Selinux to permissive for the installation. setenforce 0 First ...
user avatar
5 votes
Accepted

How to use Wikipedia templates on an outside MediaWiki?

It's a PITA and unfortunately (unlike extensions or media files) there is no repository of canned templates. Templates load other templates which load others in turn, etc. Templates are there to ...
user avatar
  • 525
4 votes

How to get visits statistics from mediawiki page, without asking this from the admin?

Another way is: Go to Special:SpecialPages of a given wiki, and check if it has Special:PopularPages; example: http://en.wikipedia.org/wiki/Special:SpecialPages - doesn't have it http://www.alsa-...
user avatar
  • 141
4 votes

How do you hot link an external image from a Media Wiki site?

Actually, [http://example.com/image.jpg] is not correct. The correct way to insert an external image into a wikimedia page is http://example.com/image.jpg eg. no square brackets. Of course, make ...
user avatar
4 votes

How to set the keep me logged in box to true in Mediawiki Special:UserLogin

(MediaWiki 1.31.0, edited 2020) Add to LocalSettings.php: $wgHooks['AuthChangeFormFields'][] = function ($requests, $fieldInfo, &$formDescriptor, $action) { $formDescriptor['rememberMe'] = ['...
user avatar
  • 41
4 votes
Accepted

Numbered MediaWiki list with pre, source or code tags inside

The other answer is incorrect. This can be done using the line option: # First # Second <source line lang="CSharp">Some Multi Line C Sharp Code </source> # Third Look, the output is ...
user avatar
  • 290
4 votes

Clone an abandoned MediaWiki site

You can use the API to export all the text content, with something like action=query&generator=allpages&export. Files you'll have to scrape via some script, such as pywikibot. You can see what ...
user avatar
  • 1,269
3 votes

How do you get MediaWiki to render URLs in the usual way?

The characters that MediaWiki disallows in URLs need to be percent-encoded. So, for example, your link should be written as http://chemapps.stolaf.edu/jmol/jmol.php?model=C%5BC@H%5D(N)CC1=CC=CC=C1 (%...
user avatar
  • 282
3 votes

Rewrite in Mediawiki, remove index.php, .htaccess

You can have clean URLs with the following step. Install the wiki into http://localhost/w and NOT into http://localhost/wiki then Modify the following in LocalSettings.php after you have set it up: $...
user avatar
  • 131
3 votes

Mediawiki: How to escape '=' in Template parameter values

The workarounds: Explicitly precede the argument with the (numerical) parameter name in the call to the template, like this: {{MyUrl|1=http://www.example.com/abstract.cfm?uri=aa-123456}} Another ...
user avatar
  • 191
3 votes

MediaWiki links to new articles don't work even after the new article is created until the page with the link is edited

Configure the wiki job queue. Link colour is not updated immediately across all of your wiki to save on resources.
user avatar
  • 588
3 votes

How to configure MediaWiki to allow uploading text/plain ".conf' files

As Stephen Ostermiller says, in this case you want to add "conf" to the line beginning with "text/plain" in: includes/mime.types In other cases though it may not be this simple. When you upload a ...
user avatar
  • 131
3 votes
Accepted

Is it possible to define and refer to constants in MediaWiki?

Yes. Use vardefine. #vardefine {{#vardefine:variablename|specifiedvalue}} https://www.mediawiki.org/wiki/Extension:Variables
user avatar
  • 365
3 votes
Accepted

How to allow MediaWiki non-users to only read some wiki pages related login and account creation?

Use wgWhitelistRead in your LocalSettings.php configuration file.
user avatar
  • 2,377
3 votes
Accepted

In MediaWiki how to display external data inline?

You can use the External Data extension for MediaWiki. This will pull data as CSV, GFF, JSON or XML, or LDAP server or database, which can then be displayed on the page. The External Data extension ...
user avatar
  • 2,727
3 votes
Accepted

Mediawiki: how to allow users to edit their User pages (but not other pages)

Not by default. You can find the list of permissions here, and the permissions each user group on a wiki has at Special:ListGroupRights. There is editmyusercss/editmyuserjs which allows users to edit ...
user avatar
  • 1,269
3 votes
Accepted

What is the function of a self-closing <nowiki/> tag in Mediawiki?

It stops the parser from eating whitespace at the beginning of the template parameter. The * needs to be at the beginning of the line (ie. preceded by a newline) to be turned into a list.
user avatar
  • 1,269
3 votes
Accepted

MediaWiki VCS backend? (Preferrably DVCS like Git or Mercurial)

I think there isn't (using off-shelf software) for the following reasons. Sql and git are very different storage systems by design. Sql is about storing lots of deeply interconnected data in a ...
user avatar
3 votes

MediaWiki VCS backend? (Preferrably DVCS like Git or Mercurial)

MediaWiki has a storage abstraction layer that makes this technically possible (the linked page talks about using external databases but it's actually not limited to that; see the documentation of the ...
user avatar
  • 1,269
3 votes
Accepted

MediaWiki: How to put $wgSitename in the sidebar?

You can add * {{SITENAME}} to MediaWiki:Sidebar and use some script to replicate that, or use the AddMessages extension or the MessagesPreLoad hook to set the text from code.
user avatar
  • 1,269
3 votes
Accepted

MediaWiki and EU cookie consent

Is this not what you are looking for? https://www.mediawiki.org/wiki/Extension:CookiePolicy?
user avatar
  • 9,599
3 votes
Accepted

How to log-in with more rights than Admin or Bureaucrat?

There are privileges which bureaucrats do not have by default, and it is possible to give those to them (or some other group or a specific user if you prefer), e.g. $wgGroupPermissions['bureaucrat'] +...
user avatar
  • 1,269
3 votes
Accepted

Where is "MediaWiki:Vector.css" of my MediaWiki

I asked a question in superuser and this answer was correct: MediaWiki:Vector.css is not a file on your filessytem. Its "just" a Wikipage. Just type "MediaWiki:Vector.css" in the searchbar and ...
user avatar
3 votes
Accepted

Clone an abandoned MediaWiki site

Backing up a wiki without server shell access, requires Python v2 (v3 didn't yet work last time I did this). From the command-line run the the WikiTeam Python script dumpgenerator.py to get an XML ...
user avatar
  • 525

Only top scored, non community-wiki answers of a minimum length are eligible