Jump to content

Topic on Project:Support desk/Flow

Frames like on mediawiki frontpage

21
86.128.197.93 (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

http://imgur.com/kkf8tBl

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;
}
84.204.22.130 (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 mediawiki.org 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).
84.204.22.130 (talkcontribs)

Thanks! I have created beautiful main page)))

195.67.147.164 (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 mediawiki.org, 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?

80.149.194.70 (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/sp.xn--fniks-vua.nu/public_html/extensions/TemplateStyles/includes/TemplateStylesContent.php: Class 'Wikimedia\CSS\Parser\Parser' not found

Backtrace:

#0 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/extensions/TemplateStyles/includes/TemplateStylesContent.php(135): TemplateStylesContent->sanitize(array)

#1 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/Revision/RenderedRevision.php(239): TemplateStylesContent->getParserOutput(Title, NULL, ParserOptions, boolean)

#2 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/Revision/RenderedRevision.php(211): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(TemplateStylesContent, boolean)

#3 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/Revision/RevisionRenderer.php(175): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)

#4 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/Revision/RevisionRenderer.php(128): 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/sp.xn--fniks-vua.nu/public_html/includes/Revision/RenderedRevision.php(175): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)

#7 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/Storage/DerivedPageDataUpdater.php(1265): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()

#8 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/Storage/PageUpdater.php(707): MediaWiki\Storage\DerivedPageDataUpdater->getCanonicalParserOutput()

#9 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/page/WikiPage.php(1886): MediaWiki\Storage\PageUpdater->saveRevision(CommentStoreComment, integer)

#10 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/EditPage.php(2285): WikiPage->doEditContent(TemplateStylesContent, CommentStoreComment, integer, boolean, User, string, array, integer)

#11 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/EditPage.php(1574): EditPage->internalAttemptSave(array, boolean)

#12 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/EditPage.php(677): EditPage->attemptSave(array)

#13 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/actions/EditAction.php(60): EditPage->edit()

#14 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/actions/SubmitAction.php(38): EditAction->show()

#15 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/MediaWiki.php(501): SubmitAction->show()

#16 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)

#17 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/MediaWiki.php(860): MediaWiki->performRequest()

#18 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/includes/MediaWiki.php(517): MediaWiki->main()

#19 /storage/content/45/1007945/sp.xn--fniks-vua.nu/public_html/index.php(42): 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!

31.17.255.177 (talkcontribs)

hi everybody,

what about the mobile view? I know this post is three years old but maybe someone has a answer.


I have the boxes on my site but can´t see them on mobiel view.


any ideas?

Docmasen (talkcontribs)

now as logged in user.

to my question above my site is antibiotika-fibel.de


thanks

Reply to "Frames like on mediawiki frontpage"