Topic on Project:Support desk

Frames like on mediawiki frontpage

19 (talkcontribs)

Hello I am new to this and wondering how mediawiki has done the frames like on the front page I have linked a image for reference

Thank you.

MarkAHershberger (talkcontribs)

They're just using CSS. Granted, finding out how the front page is formatted isn't simple, but if you edit this template, you'll see that they html ids like "mainpage_topbox" are used so that CSS from MediaWiki:Common.css (since moved to MediaWiki:Gadget-site.css) can create a box using:

#mainpage_topbox {
	background: #f9f9f9;
	padding: 0px;
	border: 1px solid #aaaaaa;
	margin: 0.2em 10px 10px;
} (talkcontribs)

I have got the same question. Could anybody explain step by step how to crate main page like on MediaWiki?

Jonkerz (talkcontribs)

Quick and dirty way:

  1. Type {{:MediaWiki}} in the "Input text" box on Special:ExpandTemplates.
  2. Copy the result to your own main page
  3. Copy everything from MediaWiki:Gadget-site.css on to MediaWiki:Common.css on your own Mediawiki installation
  4. The page will now be filled with tons of broken links, redlinks and broken file links; it will look like crap, but it will be easy to replace the content with your own
  5. Cleanup

A few things you should know:

  • Special:ExpandTemplates will substitute ALL templates, parser functions and variables, destroying the original code. The code of the main page and all used templates can be kept intact if exported using Special:Export, but a lot cleanup will be needed (e.g. cleaning up tons of templates and even installing extensions).
  • Much of the css from MediaWiki:Gadget-site.css can be removed. The rest may either be kept in your MediaWiki:Common.css or moved to your new main page (use inline css for this). (talkcontribs)

Thanks! I have created beautiful main page))) (talkcontribs)

Hi, trying to do the same thing. When trying to do the:

Type {{:MediaWiki}} in the "Input text" box on Special:ExpandTemplates.

I get no result at all. What am I doing wring?

Jonkerz (talkcontribs)

Go to Special:ExpandTemplates (on, not your local installation), enter "{{:MediaWiki}}" in the large text box labelled "Input text:" (not the small one labelled "Context title..."). Press OK. Did that work for you? (talkcontribs)

Where to move the Gadget-site.css? I've just put it in my mediawiki main folder but my main page still looks ugly.

Degn (talkcontribs)
AhmadF.Cheema (talkcontribs)
Degn (talkcontribs)

Thanks AhmadF.Cheema. I installed Extension:TemplateStyleswith no problems. But I get an error when creating Template:Main page/styles.css. In Danish versions the page is automatically converted to Skabelon:Main page/styles.css, and input of the code Template:Main page/styles.cssproduce an internal error (see below). Any idea what went wrong?

[b9f976641f9b2485d88ddf4a] /index.php?title=Skabelon:Main_page/styles.css&action=submit Error from line 78 of /storage/content/45/1007945/ Class 'Wikimedia\CSS\Parser\Parser' not found


#0 /storage/content/45/1007945/ TemplateStylesContent->sanitize(array)

#1 /storage/content/45/1007945/ TemplateStylesContent->getParserOutput(Title, NULL, ParserOptions, boolean)

#2 /storage/content/45/1007945/ MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(TemplateStylesContent, boolean)

#3 /storage/content/45/1007945/ MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)

#4 /storage/content/45/1007945/ MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)

#5 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)

#6 /storage/content/45/1007945/ call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)

#7 /storage/content/45/1007945/ MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()

#8 /storage/content/45/1007945/ MediaWiki\Storage\DerivedPageDataUpdater->getCanonicalParserOutput()

#9 /storage/content/45/1007945/ MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)

#10 /storage/content/45/1007945/ WikiPage->doEditContent(TemplateStylesContent, CommentStoreComment, integer, boolean, User, string, array, integer)

#11 /storage/content/45/1007945/ EditPage->internalAttemptSave(array, boolean)

#12 /storage/content/45/1007945/ EditPage->attemptSave(array)

#13 /storage/content/45/1007945/ EditPage->edit()

#14 /storage/content/45/1007945/ EditAction->show()

#15 /storage/content/45/1007945/ SubmitAction->show()

#16 /storage/content/45/1007945/ MediaWiki->performAction(Article, Title)

#17 /storage/content/45/1007945/ MediaWiki->performRequest()

#18 /storage/content/45/1007945/ MediaWiki->main()

#19 /storage/content/45/1007945/ MediaWiki->run()

#20 {main}

AhmadF.Cheema (talkcontribs)

Do you have SSH access on your server?

You probably need to run composer install --no-dev in the extension directory. This step should be needed only when installing Extension:TemplateStyles through git, however there appears to be some bug for the time being.

Degn (talkcontribs)

Hi AhmadF.Cheema. Yes. I tried but with "command not found". Any idea what to do?

-securelve_sh-4.1$ ls

CategoryTree ConfirmEdit  Interwiki Nuke Poem SpamBlacklist WikiEditor Cite Gadgets      LocalisationUpdate  OATHAuth README SyntaxHighlight_GeSHi CiteThisPage ImageMap MobileFrontend ParserFunctions Renameuser TemplateStyles CodeEditor    InputBox MultimediaViewer PdfHandler ReplaceText TitleBlacklist

-securelve_sh-4.1$ composer install --no-dev

-securelve_sh: composer: command not found

-securelve_sh-4.1$ cd TemplateStyles

-securelve_sh-4.1$ composer install --no-dev

-securelve_sh: composer: command not found

AhmadF.Cheema (talkcontribs)

This will depend on your website host. You'll have to ask their support, how to make composer available for your account.

Degn (talkcontribs)

Hello AhmadF. I tried again after help from support but get this error:

-securelve_sh-4.1$ composer install --no-dev

Loading composer repositories with package information

Updating dependencies

Your requirements could not be resolved to an installable set of packages.

  Problem 1

    - Installation request for mediawiki/mediawiki-codesniffer 24.0.0 -> satisfiable by mediawiki/mediawiki-codesniffer[v24.0.0].

    - mediawiki/mediawiki-codesniffer v24.0.0 requires php >= 5.6.99 -> your PHP version (5.6.33) does not satisfy that requirement.

Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.

Any suggestions? Update PHP-version?

AhmadF.Cheema (talkcontribs)

Looks like your MediaWiki installation is using PHP v7.0.32, but the command for composer is using PHP v5.6.33.

You'll probably have to ask your host how to make use of the newer PHP version in the command line, in order to be able to run the composer command.

Degn (talkcontribs)
AhmadF.Cheema (talkcontribs)
Degn (talkcontribs)

I think the problem started because I used DANISH settings. When I changed to english language the correct formatting works fine. Thank you AhmadF.Cheema for the inspiration!

Reply to "Frames like on mediawiki frontpage"