Project:Support desk

Jump to navigation Jump to search

About this board

Welcome to MediaWiki.org's Support desk, where you can ask MediaWiki questions!

There are also other places where to ask :

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using (reported by your wiki's Special:Version page):
    • MediaWiki
    • PHP
    • Database
  2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
  3. To start a new thread, click "Start a new topic".
Previous page history was archived for backup purposes at Project:Support_desk/old on 2015-07-30.
Other languages: English  العربية čeština Esperanto français 日本語 中文
Sokote zaman (talkcontribs)

Hi

I changed the home screen many times

But in search of a site, what it finds is history

I had tried these too


php deleteOldRevisions.php --delete

php rebuildtextindex.php

php deleteArchivedRevisions.php --delete


Can anyone solve this problem?

Thank you for your help

Malyacko (talkcontribs)

Please provide a specific example, plus always provide MediaWiki version information.

Sokote zaman (talkcontribs)
Reply to "Why search in history?"

Skin not loading (IONOS Hosting)

8
7heo T (talkcontribs)

Hi !

I'm not used to "coding" so I installed MediaWiki on my Ionos hosted server thanks to their build-in tool.

MediaWiki a been instaled correctly and i can browse through the pages but with no skin.

I get this error :

"Refused to apply style from '[URL]' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled."

After some reaserches I found that it can be due to short URL and that a need to create a symbolic link from /var/www pointing to /var/lib/mediawiki/[my $wgScriptPath value]. But I don't have a var folder in my wiki directory on the server. So what am I supposed to do ? It seems that my problem is linked to the fact I'm hosted by Ionos ? Have anyone already used MediaWiki with Ionos ?

Thanks for your help

MarkAHershberger (talkcontribs)

This ("Refused to apply style...") sounds like a server configuration problem.

I've set up an Ionos site just to test this since it looks like I can do that without incurring any cost. I'll come back and update this when I've tried it.

Bawolff (talkcontribs)

it can be caused by a bunch of things. Can you open the css file in your browser (or provide a link)? Is it a 404 page? Is it an error? Something else?

7heo T (talkcontribs)

The URL does not correspond to a css file but to the load.php file.

Here is the link of the wiki : http://wiki-phaeton.trescarte.com/ where will be able to see the error in the console.

MarkAHershberger (talkcontribs)

The one-click install that I did at ionos seems to work. What have you done besides the installation?

MarkAHershberger (talkcontribs)

Visiting your site shows the load.php giving http 500 errors. If you can edit the LocalSettings.php file, try turning on debugging.

Specifically, if you view-source on the load.php url, you'll see this:

Set $wgShowExceptionDetails = true; at the bottom
of LocalSettings.php to show detailed debugging
information.
7heo T (talkcontribs)

Besides doing the installation I didn't do anathing.

I've turn on debugging and now when i run the load.php file with the following parameters :

"/load.php?debug=false&lang=fr&modules=mediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.sectionAnchor%7Cmediawiki.skinning.interface%7Cskins.vector.styles&only=styles&skin=vector"

I've no more error in the console but this written on the page :

[XomgRVKlV2sAAK@2TT0AAAA-] /load.php?debug=false&lang=fr&modules=mediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.sectionAnchor%7Cmediawiki.skinning.interface%7Cskins.vector.styles&only=styles&skin=vector Error from line 657 of /homepages/17/d822040357/htdocs/clickandbuilds/MediaWiki/MyWikis/includes/exception/MWExceptionHandler.php: Class 'FormatJson' not found

Backtrace:

#0 /homepages/17/d822040357/htdocs/clickandbuilds/MediaWiki/MyWikis/includes/exception/MWExceptionHandler.php(195): MWExceptionHandler::logError(ErrorException, string, string)

#1 /homepages/17/d822040357/htdocs/clickandbuilds/MediaWiki/MyWikis/includes/AutoLoader.php(81): MWExceptionHandler::handleError(integer, string, string, integer, array)

#2 /homepages/17/d822040357/htdocs/clickandbuilds/MediaWiki/MyWikis/includes/AutoLoader.php(81): require()

#3 [internal function]: AutoLoader::autoload(string)

#4 /homepages/17/d822040357/htdocs/clickandbuilds/MediaWiki/MyWikis/includes/resourceloader/ResourceLoaderModule.php(493): spl_autoload_call(string)

#5 /homepages/17/d822040357/htdocs/clickandbuilds/MediaWiki/MyWikis/includes/resourceloader/ResourceLoaderFileModule.php(394): ResourceLoaderModule->saveFileDependencies(ResourceLoaderContext, array)

#6 /homepages/17/d822040357/htdocs/clickandbuilds/MediaWiki/MyWikis/includes/resourceloader/ResourceLoaderModule.php(742): ResourceLoaderFileModule->getStyles(ResourceLoaderContext)

#7 /homepages/17/d822040357/htdocs/clickandbuilds/MediaWiki/MyWikis/includes/resourceloader/ResourceLoaderModule.php(687): ResourceLoaderModule->buildContent(ResourceLoaderContext)

#8 /homepages/17/d822040357/htdocs/clickandbuilds/MediaWiki/MyWikis/includes/resourceloader/ResourceLoader.php(1069): ResourceLoaderModule->getModuleContent(ResourceLoaderContext)

#9 /homepages/17/d822040357/htdocs/clickandbuilds/MediaWiki/MyWikis/includes/resourceloader/ResourceLoader.php(783): ResourceLoader->makeModuleResponse(ResourceLoaderContext, array, array)

#10 /homepages/17/d822040357/htdocs/clickandbuilds/MediaWiki/MyWikis/load.php(53): ResourceLoader->respond(ResourceLoaderContext)

#11 {main}

If it worked for you maybe I will try to uninstall and reinstall it ... we never know ...

7heo T (talkcontribs)

After reinstalling I still have the same problem ...

Reply to "Skin not loading (IONOS Hosting)"

Update to 1.34.1, desktop wiki loads then blank page appears

4
Summary by AhmadF.Cheema

Old JavaScript code broke the Wiki, removing it fixed the problem.

TeraS44 (talkcontribs)

Hello!

We updated our wiki from 1.28.2 to 1.34.1 today and updated all extensions as well. Afterwards the desktop page loads, then a blank screen appears. If someone looks at the page using MobileFrontEnd, they can see any wiki page, read it, edit it and so on with no issues. This problem occurs on article and special pages, it doesn't matter what page is loaded.


Mediawiki 1.34.1 PHP 7.3.11 Database MySQL 5.7.28


Wiki is located at: succubus.net/wiki


Any advice would be very, very welcome!

AhmadF.Cheema (talkcontribs)

In your browser developer tools (opened after pressing F12), your Wiki shows a JavaScript error for "mwCustomEditButtons is not defined". Probably "mwCustomEditButtons" is being incorrectly called in some JavaScript page on your Wiki (such as MediaWiki:Common.js); find it and remove it.

TeraS44 (talkcontribs)

Thank you for explaining what is happening, as I am not very well versed in MediaWiki, how does one go and try to find mwCustomEditButtons ? For that matter, how does one edit MediaWiki:Common.js if you can't edit it inside of MediaWiki?


TeraS44 (talkcontribs)

Okay, fixed the error.

First problem was that as sysop I did not have the ability to edit site js. I added the right with:

$wgGroupPermissions['sysop']['editsitejs'] = true;

In localsettings.php

editsitejs set to true for sysops.

Then I completely blanked the MediaWiki:Common.js page and saved the blank page through the Mobile page interface. On reloading the page, the wiki cleared the javascript error and the wiki has returned to normal.

That particular MediaWiki:Common.js page had been unchanged for six years and moving to 1.34.1 broke the extraedit buttons workaround that had been installed in that file.

Thank you again for pointing me in the right direction!

Wikimedia\Rdbms\DBReadOnlyError after VM crash

10
80.128.145.126 (talkcontribs)

I run a wiki on an Apache webserver with Mysql in a Linux-VM . This VM crashed yesterday without reason and now this is happening:

*Apache is running

*MySQL opens 200+ threads with Mysqld --daemonize myslq.pid

**It tells me, that there are 14 open files

**mysqladmin says, that 140+ localhost/wiki process are sleeping (this number is constantly growing, which causes a "to many connection" error after a while)

*My VM is reaching its RAM and CPU limitation due to MySQL and freezes

*If I try to connect to my wiki via internet it either gives me a connection time out or "Wikimedia\Rdbms\DBReadOnlyError" (but the wiki wasn't in read only mode when the vm crashed)


Since I installed MediaWiki two years ago I kept it up-to-date, made two successful upgrades to the recent versions and never changed the apache/mysql default settings (with exclusion of user/password) and it all worked fine. Until yesterday.


Further testing/logging within the wiki isn't possible due to the nature of the problem. I can't provide any log files.

80.128.145.126 (talkcontribs)

I have to correct myself: After many reloads I finally got an error log.

And again: I have no idea why it says "Read-only". I checked the LocalSettings and it's not read only.


MediaWiki internal error.

Original exception: [3b46c182321d3ea4b8b9902a] /wiki/Mainpage Wikimedia\Rdbms\DBReadOnlyError from line 1121 of /var/lib/mediawiki/includes/libs/rdbms/database/Database.php: Database is read-only

Backtrace:

#0 /var/lib/mediawiki/includes/libs/rdbms/database/Database.php(2010): Wikimedia\Rdbms\Database->query(string, string)

#1 /var/lib/mediawiki/includes/objectcache/SqlBagOStuff.php(414): Wikimedia\Rdbms\Database->update(string, array, array, string)

#2 /var/lib/mediawiki/includes/libs/objectcache/BagOStuff.php(316): SqlBagOStuff->cas(array, string, array, integer)

#3 /var/lib/mediawiki/includes/objectcache/SqlBagOStuff.php(488): BagOStuff->mergeViaCas(string, Closure, integer, integer)

#4 /var/lib/mediawiki/includes/libs/objectcache/WANObjectCache.php(549): SqlBagOStuff->merge(string, Closure, integer, integer)

#5 /var/lib/mediawiki/includes/cache/MessageCache.php(732): WANObjectCache->set(string, array, integer)

#6 /var/lib/mediawiki/includes/cache/MessageCache.php(671): MessageCache->setValidationHash(string, array)

#7 /var/lib/mediawiki/includes/cache/MessageCache.php(420): MessageCache->saveToCaches(array, string, string)

#8 /var/lib/mediawiki/includes/cache/MessageCache.php(342): MessageCache->loadFromDBWithLock(string, array, NULL)

#9 /var/lib/mediawiki/includes/cache/MessageCache.php(971): MessageCache->load(string)

#10 /var/lib/mediawiki/includes/cache/MessageCache.php(928): MessageCache->getMsgFromNamespace(string, string)

#11 /var/lib/mediawiki/includes/cache/MessageCache.php(868): MessageCache->getMessageForLang(Language, string, boolean, array)

#12 /var/lib/mediawiki/includes/cache/MessageCache.php(808): MessageCache->getMessageFromFallbackChain(Language, string, boolean)

#13 /var/lib/mediawiki/includes/Message.php(1290): MessageCache->get(string, boolean, Language)

#14 /var/lib/mediawiki/includes/Message.php(1006): Message->fetchMessage()

#15 /var/lib/mediawiki/includes/specialpage/SpecialPage.php(840): Message->isDisabled()

#16 /var/lib/mediawiki/includes/specials/SpecialRecentchanges.php(164): SpecialPage->addHelpLink(string, boolean)

#17 /var/lib/mediawiki/includes/specialpage/SpecialPage.php(565): SpecialRecentChanges->execute(NULL)

#18 /var/lib/mediawiki/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)

#19 /var/lib/mediawiki/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)

#20 /var/lib/mediawiki/includes/MediaWiki.php(861): MediaWiki->performRequest()

#21 /var/lib/mediawiki/includes/MediaWiki.php(524): MediaWiki->main()

#22 /var/lib/mediawiki/index.php(42): MediaWiki->run()

#23 {main}

Exception caught inside exception handler: [3b46c182321d3ea4b8b9902a] /wiki/Mainpage Wikimedia\Rdbms\DBReadOnlyError from line 1121 of /var/lib/mediawiki/includes/libs/rdbms/database/Database.php: Database is read-only

Backtrace:

#0 /var/lib/mediawiki/includes/libs/rdbms/database/Database.php(2010): Wikimedia\Rdbms\Database->query(string, string)

#1 /var/lib/mediawiki/includes/objectcache/SqlBagOStuff.php(414): Wikimedia\Rdbms\Database->update(string, array, array, string)

#2 /var/lib/mediawiki/includes/libs/objectcache/BagOStuff.php(316): SqlBagOStuff->cas(array, string, array, integer)

#3 /var/lib/mediawiki/includes/objectcache/SqlBagOStuff.php(488): BagOStuff->mergeViaCas(string, Closure, integer, integer)

#4 /var/lib/mediawiki/includes/libs/objectcache/WANObjectCache.php(549): SqlBagOStuff->merge(string, Closure, integer, integer)

#5 /var/lib/mediawiki/includes/cache/MessageCache.php(732): WANObjectCache->set(string, array, integer)

#6 /var/lib/mediawiki/includes/cache/MessageCache.php(671): MessageCache->setValidationHash(string, array)

#7 /var/lib/mediawiki/includes/cache/MessageCache.php(420): MessageCache->saveToCaches(array, string, string)

#8 /var/lib/mediawiki/includes/cache/MessageCache.php(342): MessageCache->loadFromDBWithLock(string, array, NULL)

#9 /var/lib/mediawiki/includes/cache/MessageCache.php(971): MessageCache->load(string)

#10 /var/lib/mediawiki/includes/cache/MessageCache.php(928): MessageCache->getMsgFromNamespace(string, string)

#11 /var/lib/mediawiki/includes/cache/MessageCache.php(868): MessageCache->getMessageForLang(Language, string, boolean, array)

#12 /var/lib/mediawiki/includes/cache/MessageCache.php(808): MessageCache->getMessageFromFallbackChain(Language, string, boolean)

#13 /var/lib/mediawiki/includes/Message.php(1290): MessageCache->get(string, boolean, Language)

#14 /var/lib/mediawiki/includes/Message.php(982): Message->fetchMessage()

#15 /var/lib/mediawiki/includes/skins/Skin.php(1348): Message->exists()

#16 /var/lib/mediawiki/includes/skins/Skin.php(1305): Skin->addToSidebarPlain(array, string)

#17 /var/lib/mediawiki/includes/skins/Skin.php(1261): Skin->addToSidebar(array, string)

#18 /var/lib/mediawiki/includes/skins/Skin.php(1287): Skin->{closure}()

#19 /var/lib/mediawiki/includes/skins/SkinTemplate.php(481): Skin->buildSidebar()

#20 /var/lib/mediawiki/includes/skins/SkinTemplate.php(249): SkinTemplate->prepareQuickTemplate()

#21 /var/lib/mediawiki/includes/OutputPage.php(2388): SkinTemplate->outputPage()

#22 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(137): OutputPage->output()

#23 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(54): MWExceptionRenderer::reportHTML(Wikimedia\Rdbms\DBReadOnlyError)

#24 /var/lib/mediawiki/includes/exception/MWExceptionHandler.php(75): MWExceptionRenderer::output(Wikimedia\Rdbms\DBReadOnlyError, integer)

#25 /var/lib/mediawiki/includes/exception/MWExceptionHandler.php(149): MWExceptionHandler::report(Wikimedia\Rdbms\DBReadOnlyError)

#26 /var/lib/mediawiki/includes/MediaWiki.php(551): MWExceptionHandler::handleException(Wikimedia\Rdbms\DBReadOnlyError)

#27 /var/lib/mediawiki/index.php(42): MediaWiki->run()

#28 {main}

80.128.145.126 (talkcontribs)

Update: After using the "SET GLOBAL read_only = OFF;" command in mysql, I don't get any time outs anymore but blank pages without any information.

80.128.145.126 (talkcontribs)

Update: This is the last entry of the Apache errorlog.


[Fri Apr 03 19:42:38.978709 2020] [php7:error] [pid 22088] [client 46.229.168.151:31960] PHP Fatal error: Uncaught Error: Call to a member function getCode() on null in /var/lib/mediawiki/includes/user/User.php:1737\nStack trace:\n#0 /var/lib/mediawiki/includes/user/User.php(5417): User::getDefaultOptions()\n#1 /var/lib/mediawiki/includes/user/User.php(3101): User->loadOptions()\n#2 /var/lib/mediawiki/includes/context/RequestContext.php(336): User->getOption('language')\n#3 /var/lib/mediawiki/includes/Message.php(380): RequestContext->getLanguage()\n#4 /var/lib/mediawiki/includes/Message.php(1290): Message->getLanguage()\n#5 /var/lib/mediawiki/includes/Message.php(842): Message->fetchMessage()\n#6 /var/lib/mediawiki/includes/Message.php(934): Message->toString('text')\n#7 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(201): Message->text()\n#8 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(301): MWExceptionRenderer::msg('dberr-problems', 'Sorry! This sit...')\n#9 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(52): MWExceptionRenderer::reportOutageHTML(Object(Wikimedia\Rdbms\DBCon in /var/lib/mediawiki/includes/user/User.php on line 1737

MarkAHershberger (talkcontribs)

Do you have a database backup? If you do, you should drop the database and restore from the backup.

If you don't, then your best bet is to try to use rebuild or repair the DB.

Bawolff (talkcontribs)

yeah, this sounds like a mysql error not a mediawiki error

87.157.184.253 (talkcontribs)

The database checked ok. I narrowed down the error to PHP, because in some brief moments I somehow get the Mainpage with my content; but most of the time I get a blank page. I don't get any php error logs thou. Only blank pages even with error reporting on.

87.157.184.253 (talkcontribs)

Here is a snippet from the Apache error log. It basically contains only this message since the VM crash:


[Wed Apr 01 06:18:42.710098 2020] [php7:error] [pid 27133] [client 114.119.161.74:12918] PHP Fatal error:  Uncaught Error: Call to a member function getCode() on null in /var/lib/mediawiki/includes/user/User.php:1737\nStack trace:\n#0 /var/lib/mediawiki/includes/user/User.php(5417): User::getDefaultOptions()\n#1 /var/lib/mediawiki/includes/user/User.php(3101): User->loadOptions()\n#2 /var/lib/mediawiki/includes/context/RequestContext.php(336): User->getOption('language')\n#3 /var/lib/mediawiki/includes/Message.php(380): RequestContext->getLanguage()\n#4 /var/lib/mediawiki/includes/Message.php(1290): Message->getLanguage()\n#5 /var/lib/mediawiki/includes/Message.php(842): Message->fetchMessage()\n#6 /var/lib/mediawiki/includes/Message.php(934): Message->toString('text')\n#7 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(201): Message->text()\n#8 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(301): MWExceptionRenderer::msg('dberr-problems', 'Sorry! This sit...')\n#9 /var/lib/mediawiki/includes/exception/MWExceptionRenderer.php(52): MWExceptionRenderer::reportOutageHTML(Object(Wikimedia\\Rdbms\\DBCon in /var/lib/mediawiki/includes/user/User.php on line 1737


Maybe one of the MediaWiki-php's got fried in the crash event?

Bawolff (talkcontribs)

thats just an error in displaying the page that reports the db is broken.

This is definitely primarily your database being broken plus an additional issue with the code that turns that into a friendly error message being also broken. However the primary issue is that your database is broken

87.157.184.253 (talkcontribs)

After much tinkering and reconsidering, I'm going to rebuild the Database via the last backup I luckely took half a day before the crash. But if there's a bigger problem within the database, this only will create an endless loop of getting the wiki back online and losing it half a day later.

Reply to "Wikimedia\Rdbms\DBReadOnlyError after VM crash"

Downloading MediaWiki - is it right for my uses?

5
Marshallsumter (talkcontribs)

I have an iMac that runs macOS Mojave Version 10.14.6 with the 3 GHz Intel Core i5 Processor, 8 GB 2667 MHz DDR4 Memory and Radeon Pro 560X 4 GB Graphics. I've really enjoyed the way MediaWiki presents articles and resources on the various Wikimedia Foundation projects. So, I'd like to find out if I can run MediaWiki on my computer, prepare resources in the course of my research and upload them to one or more of the projects I currently contribute to when it's appropriate to put them into the Public Domain. Currently, I contribute primarily to Wikiversity but have run into a political problem that I cannot solve so I'd like to try preparing resources from home. Can you help?

AhmadF.Cheema (talkcontribs)

Wouldn't unpublished Draft articles (like Wikipedia:Drafts or in your personal userspace) work for you?

Bawolff (talkcontribs)

yes, you can setup mediawiki on your mac and your mac is more than powerful enough. See Download

There are also groups that offer mediawiki hosting (ususlly for a fee, although some like miraheze or shoutwiki are free) if you want your own private wiki but dont want to do the setup yourself.

If you run into trouble setting things up or any of the instructions are confusing dont hesitate to ask for clarification.

Marshallsumter (talkcontribs)

I've downloaded MediaWiki 1.34.1, it's self-installed, then Apache 2.4.43, which self-installed, into the same folder with MediaWiki 1.34.1, but after PHP 7.4.4 downloaded as "php-7.4.4.tar.gz.download" and Keys found GPG Keys on php Downloads states "The releases are tagged and signed in the PHP Git Repository. The following official GnuPG keys of the current PHP Release Manager can be used to verify the tags:" but the PHP: Git Access for PHP 7.4 is something called "bison" on [./Ftp://ftp.gnu.org/pub/gnu/ the GNU FTP site]. It wants to open "Finder"? Is this correct?

Bawolff (talkcontribs)

For apache and php you probably want to download a different way. I would reccomend using MAMP or brew to install them.

Reply to "Downloading MediaWiki - is it right for my uses?"

How to use IsFileCacheable hook

3
T0lk (talkcontribs)

Extension:AccessControl (https://github.com/wikimedia/mediawiki-extensions-AccessControl/tree/REL1_34) should probably not let rebuildFileCache.php cache pages that are supposed to be access restricted. I see Manual:Hooks/IsFileCacheable can be used.

Unfortunatey there are no examples of this hook Category:IsFileCacheable extensions, is this correct in AccessControl.hooks.php:

<?php
use MediaWiki\MediaWikiServices;
class AccessControlHooks {
        public static function isFileCacheable (&$article) {
        $matches = [];

        $text = $article->getParserOutput(
            // 0 gets the current ID
            0, // $article->mOldId,
            // Don't have a user (and hopefully shouldn't need one as just grabbing tags)
            null
        )->getRawText();

        $parser = MediaWikiServices::getInstance()->getParser();
        $parser->extractTagsAndParams(['accesscontrol'], $text, $matches);

        return !count($matches);
        }
        ...
}
MarkAHershberger (talkcontribs)
Bawolff (talkcontribs)

well at the very least it would be better to call $parser->getOutput()->setExtensionData() in the parser tag handler, and then check ->getExtensionData() inside this hook

Reply to "How to use IsFileCacheable hook"

We couldn't make a citation for you. You can create one manually using the "Manual" tab above.

2
Summary by Reception123

The fix has been found

Reception123 (talkcontribs)

Hi. I'm getting this error with Citoid and I can't figure out what's wrong. I checked the instructions on the extension page and the suggestions didn't change anything, except the API says:

{

   "batchcomplete": "",
   "pages": {}

}

Malyacko (talkcontribs)

Noone knows, as you provided zero steps to reproduce.

syntaxhighlight custom colors

5
Sokote zaman (talkcontribs)

How do I black out the font and background color?


1 C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip uninstall camelcase
2 Uninstalling camelcase-02.1:
3   Would remove:
4     c:\users\Your Name\appdata\local\programs\python\python36-32\lib\site-packages\camecase-0.2-py3.6.egg-info
5     c:\users\Your Name\appdata\local\programs\python\python36-32\lib\site-packages\camecase\*
6 Proceed (y/n)?
MarkAHershberger (talkcontribs)

Could you point to an example of what you want to do? It sounds like you would need to use a span and some CSS.

Sokote zaman (talkcontribs)

<div style="padding: 8px 20px;margin-bottom: 30px; text-align: left; clear: both; box-shadow: none!important; overflow-x: auto; background-color: none;">{{{title|}}} [[Image:Syntax.png|70px]]

{{#ifeq:{{{showlinenumbers|false}}}|true

|{{#tag:syntaxhighlight|{{{source|{{{1|}}}}}}|lang="{{{lang|text}}}"|highlight="{{{highlight|}}}"|enclose="div"|line="true"| style=" background: none;"}} |{{#tag:syntaxhighlight|{{{source|{{{1|}}}}}}|lang="{{{lang|text}}}"|highlight="{{{highlight|}}}"|enclose="div"|style=" background: none;"}}

}}

</div>


https://wikicod.ir/wiki/%D8%A7%D9%84%DA%AF%D9%88:%D8%B3%DB%8C%D9%86%D8%AA%DA%A9%D8%B3:%DA%A9%D9%86%D8%B3%D9%88%D9%84

AhmadF.Cheema (talkcontribs)

The pre/syntaxhighlight element will have to be included inside a div element which would define a new class such as syntaxhighlight-custom-color. Then that class will be used to define the new colour rules in MediaWiki:Common.css, something like:

.syntaxhighlight-custom-color pre { background-color: black; }
.syntaxhighlight-custom-color pre > font { color: red; }

Template:Terminal might be of interest to you.

Sokote zaman (talkcontribs)

Thank you for your guidance

What command should be used for highlight syntaxhighlight style?

thank you

Reply to "syntaxhighlight custom colors"
Sokote zaman (talkcontribs)
MarkAHershberger (talkcontribs)

I don't understand what you're asking. Could you clarify what you want?

Sokote zaman (talkcontribs)

Yes, thank you

More explanation:

I want to have buttons on some pages and not buttons on some pages.

How do I show or not show a button in a template consisting of several patterns?

Thanks

MarkAHershberger (talkcontribs)

When do you want the button to show up? If it is something on the page, I think you could do this with some JS in your Common.js.

Sokote zaman (talkcontribs)

Thank you for your response

I want some pages to be just syntax and some pages to be syntax with buttons.

Sokote zaman (talkcontribs)

How can I fix this problem?

MarkAHershberger (talkcontribs)

"Some pages to be just syntax" -- could you point to an example on your wiki where you want this to happen? I still don't understand your question. It looks like you know how to make buttons (you made a couple here), why can't you do that on your wiki?

Sokote zaman (talkcontribs)

Yes, an example was created on Wiki

https://wikicod.ir/wiki/Test

Note that the first example is with the button

And

The second example is without a button

The above examples are shown with two patterns.

My question is how can I show both of the above examples by creating a template

Thanks

AhmadF.Cheema (talkcontribs)

If you want to include or exclude the button on a per-page basis, maybe you can try employing the ##if parser function used on Magic words#Page names in your template.

Something like: For two pages Page_A, Page_A_with-button

If {{PAGENAME}} includes the word button (can be checked using ##explode:), then allow button to be displayed otherwise not.

In case these patterns are to be included in the same page, simple if conditional statements should work.

Sokote zaman (talkcontribs)

Thank you for your guidance

It would be great if you could give an example

thank you

AhmadF.Cheema (talkcontribs)

Do you want the button inclusion/exclusion on a per-page basis or is it that there would be some elements with button and others without the button on the same page?

Sokote zaman (talkcontribs)

is it that there would be some elements with button and others without the button on the same page

Reply to "template show or hide"

Cant see friends most of the time

2
2601:989:457E:1530:846A:F336:6236:52BB (talkcontribs)

Been having trouble seeing my friends lobby on pavlov. and dont understand why. we didnt have this trouble when we first started playing.

Bawolff (talkcontribs)

this page is only for questions about mediawiki. We cant answer questions on other topics

Reply to "Cant see friends most of the time"