I am not talking about anything related to Fandom.
Hi, How do I get {{USERNAME}} working on a non-Fandom wiki? I ripped code from Uncyclopedia but it straight doesn't work.
Welcome to the MediaWiki Support desk, where you can ask MediaWiki questions!
(Read this message in a different language)
|
I am not talking about anything related to Fandom.
Hi, How do I get {{USERNAME}} working on a non-Fandom wiki? I ripped code from Uncyclopedia but it straight doesn't work.
Please see "Post a new question" in the sidebar, and explain what {{USERNAME}} is or does, and where you found it (link), etc. Please provide sufficient context. Thanks!
I found it on Fandom's Dev wiki. There is also a template of it on Uncyclopedia (the english one btw) and it's on lots of wikis on Fandom. I just need the JS code for it to work on a non-Fandom wiki (such as Meowpedia, which is on Miraheze)
Looks like the template is at https://en.uncyclopedia.co/wiki/Template:USERNAME and the JavaScript is at https://en.uncyclopedia.co/wiki/MediaWiki:Common.js:
/** Show username ********************************************************
* The annoying hack used by [[Template:USERNAME]]!
* Inserts user name into <span class='insertusername'></span>
* Originally by [[wikia:User:Splarka|Splarka]], [[User:Spang]]
* New version by [[User:Bizzeebeever]]
*/
$j( function() {
var name = mw.config.get( 'wgUserName' );
if ( !window.disableUsernameReplace && name ) {
$j( 'span.insertusername' ).text( name );
}
} );
It doesn't work on my wiki sadly. Does it require an extension or something? Or how else am I going to get it to work?
If it "doesn't work", which exact code did you put into which exact place(s)?
I put it somewhere at the top in Meowpedia’s sitewide JS. I put the JS script from the English Uncyclopedia, but it doesn’t work.
Please be specific and please leave zero room for interpretation and please always provide exact page names. Thanks. If you check your web browser's Developer Tools' console, which errors are shown?
It looks like $j
is being used on that other wiki for jQuery, but it's not set up like that on yours.
You could avoid jQuery and do something like this:
Array.from( document.getElementsByClassName( 'insertusername' ) ).forEach( e => { e.innerText = mw.config.get( 'wgUserName' ) || 'Anon.'; } );
Okay, anyways, why doesn't jQuery not work for MediaWiki 1.39?
That's probably to niche for us to make it a MW core magic word.
You could create an extension, or you could use Extension:Scribunto (or parser functions with string functions enabled) to make something equivalent.
Try this: [[File:{{#explode:{{PAGENAME}}|.|-2}} 2.{{#explode:{{PAGENAME}}|.|-1}}]]
I have tried this:
{{קוד_חד_שורתי|{{=}}}}
But instead of getting a =
, I get:
תבנית:=
Why?
You are likely getting the Hebrew equivalent to a red link of Template:=
If that is the case, you just need to click the red link and create the template page with nothing in it but =
.
It worked as Bawolff suggested.
Jonathan3 I need to print =
inside various templates.
Maybe this is an XY Problem scenario! I solved Y (your attempted solution) but Bawolff worked out and solved X (the underlying problem) :-)
The only problem I have is that I don't understand why
{{קוד_חד_שורתי|{{=}}}}
Gave the output of a red link
תבנית:=
In the first place.
see comment after my "bump" comment
I noticed recently that the Upload link that is supposed to lead to Special:UploadWizard (I had put in the lines in LocalSettings.php to make the upload link to UploadWizard) disappeared from the Toolbox section of links on the sidebar. I have absolutely no idea what happened or what I'm supposed to do. I first tried deleting the lines in LocalSettings to convert the Upload link to UploadWizard, and reloaded, it didn't work. Then I tried this: Manual:Interface/Sidebar#Add or remove toolbox sections (JavaScript), but that only added the CategoryTree link. If anyone could help that'd be great, thanks
I didn't have code in LocalSettings.php that wasn't working. I had installed and used UploadWizard before, and have use the command (to turn the Upload link in the Toolbox into a link from Special:Upload to Special:UploadWizard):
$wgExtensionFunctions[] = function() {
$GLOBALS['wgUploadNavigationUrl'] = SpecialPage::getTitleFor( 'UploadWizard' )->getLocalURL();
return true;
};
before, and it worked then and initially when I tried it again a while ago when I installed UploadWizard again. What I was saying was that some time ago the Upload link in the toolbox completely disappeared, and so while trying to figure it out, I tried deleting the above lines of code to see if it reappears, but when I did so the link still didn't come back.
I finally was able to resolve the issue for the most part. It didn't really have anything to do with UploadWizard, rather there was a file called Mediawiki:Common.js (type that in the url to find it) which for some reason at the end of the js file included:
function CustomizeModificationsOfSidebar() { // adds Special:CategoryTree to toolbox ModifySidebar( 'add', 'toolbox', 'CategoryTree', 'https://wwii-archives.org/index.php/Special:CategoryTree'); // removes Special:Upload from toolbox ModifySidebar( 'remove', 'toolbox', 'Upload file', 'https://wwii-archives.org/index.php/Special:UploadWizard' ); }
jQuery( CustomizeModificationsOfSidebar );
I just changed the second one to 'add' instead of 'remove' and it came back.
Is this the place to discuss web fonts?
We have a CC font that includes the Kaktovik numeral block that was just added to Unicode. The glyphs are the ones used for the Unicode proposal. I can trim it down to just the Kaktovik block, if that's something we could use here.
Don't know if I'll be notified on WP-en if you ping me here...
Probably not the best place.
Maybe file a task at https://phabricator.wikimedia.org being sure to include UniversalLanguageSelector in the tags field.
Thanks (and yes, the ping went through, even though I have a separate sign-in here)
There's been some discussion on Phabricator, but the project is still open. T320581. The font has been uploaded, but deploying it is beyond my skill level. If anyone here would like to help out, I'd appreciate it. It would be nice for the Iñupiat community for this to display properly.
This is the wrong place, as this place is not about configuring Wikimedia wikis. See Communication. https://phabricator.wikimedia.org/T320581 is the right place.
Indeed, but presumably there are people here who are capable of installing a web font.
Maybe there are also people in the supermarket who can install a web font. :) My point is that forumshopping usually doesn't help much...
Is it possible to create dynamic tooltips Using Only CSS? I don't mind if it involves JavaScript as long as it is not too complicated.
What are "dynamic tooltips"? Which underlying problem made you think of this potential solution? How is this related to MediaWiki at all?
Depends what you mean by dynamic, but generally yes.
Two approaches:
I use the unmaintained Extension:SimpleTooltip with MW 1.35 and it still seems to work all right. I see there's a fork of it for 1.38+ at Extension:SimpleTooltip (Universal-Omega). Here's another (maybe I should use it instead): Extension:RegularTooltips. You could see how they go about things. Maybe it's just CSS.
Hello,
I have a wiki that throws me an error whenever I try to edit a page:
[3944b0b33bcfb4fc5601e9b1] /geowiki/index.php?title=Hauptseite&action=tinymceedit Wikimedia\Assert\ParameterTypeException: Bad value for parameter $target: must be a MediaWiki\Linker\LinkTarget|MediaWiki\Page\PageReference
Backtrace:
from /srv/www/htdocs/geowiki/vendor/wikimedia/assert/src/Assert.php(105)
#0 /srv/www/htdocs/geowiki/includes/linker/LinkRenderer.php(156): Wikimedia\Assert\Assert::parameterType()
#1 /srv/www/htdocs/geowiki/extensions/SelectCategory/SelectCategory_body.php(109): MediaWiki\Linker\LinkRenderer->makeLink()
#2 /srv/www/htdocs/geowiki/includes/HookContainer/HookContainer.php(338): SelectCategory::showHook()
#3 /srv/www/htdocs/geowiki/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#4 /srv/www/htdocs/geowiki/includes/HookContainer/HookRunner.php(1588): MediaWiki\HookContainer\HookContainer->run()
#5 /srv/www/htdocs/geowiki/includes/EditPage.php(3148): MediaWiki\HookContainer\HookRunner->onEditPage__showEditForm_initial()
#6 /srv/www/htdocs/geowiki/includes/EditPage.php(778): EditPage->showEditForm()
#7 /srv/www/htdocs/geowiki/extensions/TinyMCE/TinyMCEAction.php(36): EditPage->edit()
#8 /srv/www/htdocs/geowiki/includes/MediaWiki.php(542): TinyMCEAction->show()
#9 /srv/www/htdocs/geowiki/includes/MediaWiki.php(322): MediaWiki->performAction()
#10 /srv/www/htdocs/geowiki/includes/MediaWiki.php(904): MediaWiki->performRequest()
#11 /srv/www/htdocs/geowiki/includes/MediaWiki.php(562): MediaWiki->main()
#12 /srv/www/htdocs/geowiki/index.php(50): MediaWiki->run()
#13 /srv/www/htdocs/geowiki/index.php(46): wfIndexMain()
#14 {main}
When an article has nested headlines and I click on "Edit" next to one of the nested headlines, it works flawlessly. That goes for TinyMCE as well as the Wiki source editor.
All my other wikis work flawlessly.
I found a reference to that error in phabricator, but that thread deals with the extension LiquidThreads, and I don't use that.
@Ablum010777 Please see "Post a new question" in the sidebar, and also provide the exact version of the "SelectCategory" extension used.
That extension looks like it's ancient. What are the MW versions of your other wikis and this one, and do they all have this extension?
"When an article has nested headlines and I click on "Edit" next to one of the nested headlines, it works flawlessly." - likely the extension only gets used when a whole page is edited.
Maybe try to comment it out of LocalSettings.php and see how you go.
Please excuse me if this is a common question but I've been going around in circles in the docs and not found what I'm looking for.
I want to use mediawiki as a documentation tool. I have 1.5 million objects curated in a bespoke system accessible through an API. I want a wikki page for each of these objects that contains the data in the object in a non-editable form at the start of the page. Wiki users can then edit these pages to document the objects but not edit or remove the externally curated data.
I'm a professional PHP coder so no issue writing an extension. What I need help with is a strategy. I don't want to head down the wrong road at the start!
At what point in the rendering process would it be best to insert the external content? The page ID would be the object ID so I don't need to store any data in the page. I would know what to add right from the start.
Your thoughts most welcome, thanks.
I uploaded somefiles but my internet connection snapped. Somehow the files won't appear and create an Error Code 1. I plan to just overwrite this files but mediawiki just won't allow it. I just wanna delete this files and reupload them thank you.
I need to upgrade from MediaWiki 1.25.2 to 1.39.2. I understand I need to upgrade from 1.25.2 to 1.35.9, and then upgrade to 1.39.2. I also need to migrate the application server from Windows Server 2012 R2 to Windows Server 2019. My question is how much of the upgrade should be done on the Windows 2012 server before moving to the Windows 2019 server? I am guessing since I can't get 1.25.2 I should upgrade to 1.35.9, move to the Windows 2019 server and then upgrade to 1.39.2. Thoughts?
I've never used a Windows server but imagine as far as MediaWiki is concerned, it's still the PHP and database versions that matter. As long as you can transfer the files and database to a server on which the update.php script will run, you'll be all right, I think.