Topic on Extension talk:MobileFrontend

Yellowdog (talkcontribs)

In which file in the directory 'extensions/MobileFrontend/' or in its subdirectories is it possible to add a bit of HTML to include a logo with a simple <img src=...> tag to appear just below the navigational topics?

Jdlrobson (talkcontribs)

Try editing "resources/mobile.mainMenu/menu.mustache" - that should do what you want.

Yellowdog (talkcontribs)

Thanks for the tip! That would otherwise have taken me forever to find :-)

Yellowdog (talkcontribs)

I realised after modifying the file including a bit of Javascript, such as <script>document.write(document.title)</script> for example, makes the left menu and content page disappear and display the document.title only in any browser device. This must be because the menu already exists but is hidden but dynamically pulled out, using Javascript I guess. Obviously it's not possible to document.write to an already loaded document by executing document.write. So if I would like to use a bit of Javascript in writing out some HTML bits in the menu.mustache, I think the HTML object needs to be pre-written in Javascript as the page loads, but where?

Many thanks for any comments!

Tuxedo

Why the 'mustache' in the menu?

Jdlrobson (talkcontribs)

This is no meant for scripts If you want to add scripts you should add them inside MediaWiki:Mobile.js or MediaWiki:Minerva.js. Any other HTML should be fine in there.

If you want to change the structure of the menu you may also want to explore tweaking the value of mw.config.values.wgMinervaMenuData

Yellowdog (talkcontribs)

Thanks, I found Mobile.js works on the version of my installed MobileFrontend.

Also, does anyone here know if there's a way to add something in LocalSettings to appear in the footer part of Mobile views? Maybe a similar way to how skin modifications in the Desktop view exists:

$wgHooks['SkinBuildSidebar'][] = 'fnNewSidebarItem';
function fnNewSidebarItem( $skin, &$bar ) {
$out = "here goes some text and <b>html</b> parts\n";
$out .= "and some more\n";
$bar[ 'hello' ] = $out;
return true;
}

And is it possible to output the html between the "Last edited ..." and the "SiteName | Mobile | Desktop | Privacy links" sections, or above or below all.

Or if no hook is available for the footer section, which MobileFrontend file can the html bits be hardcoded into?