About this theme
The monobook theme, available from the ThemeMarket is an adaption of the default theme from wikipedia. It uses a complete copy of the css style sheet from wikipedia, then applies some moin-specific alterations afterwards. Hopefully this should mean any other style sheets developed for MediaWiki can be used directly.
Most of the changes involve using the monobook.py file to output HTML that is closer to the MediaWiki format. These changes are:
- Send all the page headers, footers, and sidebar content at the end of the page rather than the beginning. This makes the content more accessible for screen readers, and means the content loads before the extra aids.
- Alter the tab list to be a set of actions that can be applied to the current page, rather than global site links
- Move the page links, search bar, and remaining action links to a side bar
- Remove the actions submission form, and replace with links (I'm not sure if this is a good idea - with a large list of actions this can be confusing)
- Add Access Keys and Title tags for common page actions, links and search bar
- Add a right-to-left patch up to the theme - wikipedia uses a separate css file for rtl languages
- Move the page status into the global footer
- Switch the 'immutable page' text to a 'view raw text' link - this would look better if a read only text area was displayed like on wikipedia.
Some other notes
- Not sure yet how many customizations may be broken - the custom page headers and footers aren't emitted currently
Includes support for SinglePageSlideShows
the page editor form will look bad if a patch for MoinMoinBugs/PageEditorIgnoresThemeFooter is not applied.
If your page logo is smaller than the one at wikipedia, try adjusting the line #column-one { padding-top: 160px; } in monobook.css
Comments, Questions, Suggestions
2010-04-29: a dedicated bitbucket repository for this theme has been created: https://bitbucket.org/moin/moin-theme-monobook.
Aim is to make it easier to maintain themes (esp in applying patches) in a community fashion.
- I (Rufus Pollock) have attempted to apply all the main patches described here
Want others to take over/participate and will give write permission (or pull patches) from anyone forking or making a pull request.
Great work! It can be very nice for those who want a wikipedia/media wiki like design.
However, I'm not sure that its done right (I did not look into the code, only read the description here):
- navigation bar does not have to change, just designed differently with css
- The tab at the top of the page are the editbar with different design
- the part with the action names its the actionMenu with different implementation, a list instead of a menu.
-- NirSoffer 2005-04-16 22:49:23
- I agree with each of these comments:
- For the navi bar, the only change from the default theme is to add access keys - most is done in css already
- For the editbar, again access keys were added - also the output was tweaked to include an 'active action' class
- The action bar is a more significant override (actually in the source its called 'toolbox' at the moment - this should change to actionmenu for v0.2) Mainly the changes in the theme code are to add the wikipedia/media wiki specific divs - I'm sure this could have been achieved by adapting more of the monobook css tags to match the moin output, but personally I found adapting the python code simpler ;-), also this way means that existing mediawiki stylesheets can be used directly in moin. The code can be improved plenty, but it's mainly in line with what you say.
-- JimClark there seem to be some disadvantages in this approach:
- searching for a word, and then opening it out of the search result, you get a "highlight" in the url, and links like "delete page" are not available any more.
- no trail available.
The theme name is strange. Why not WikiPedia, MediaWiki, MoinMedia or MoinPedia?
No reason, just copied from the css name. MoinPedia is better actually, and reflects that is an moin interpretation of some wikipedia ideas. The original idea was because several of my users claimed they preferrred the wikipedia interface to the moin one. I think actually all they were missing was the access key links, but I wanted to show what could be done with this system.
This will enable MoinMoin to emulate Wikipedia and confuse all users. I am currently working on assembling MonoBook, the MediaWiki parser, the current WikiPedia data and the VirtualPage plugin. -- AlexanderSchremmer 2005-04-18 22:07:47
- See WikiPediaForMoinMoin
I found a bug in Python which is triggered by the CSS files of the theme if they are served by the standalone server of MoinMoin. Please unify the line endings to \n (UNIX) in the .CSS files. Thanks! -- AlexanderSchremmer 2005-04-26 21:24:06
Sorry about that - now fixed for 0.2 -- JimClark
Congratulations for your work Jim, Just one question. Are there is no trails? Thanks. -- -- EduardoMercovich 2005-05-20 15:45:12
-- RobertSeeger 2005-10-06 23:14:56 Here is a very simple method to add a portlet for the trail:
1 def navibar(self, d):
2 ...
3 html = [
4 ##RS trail in extra portlet
5 u'<div class="portlet" id="p-nav">',
6 u'<div class="pBody">',
7 self.trail(d),
8 u'</div>',
9 u'</div>',
10 ##RS end
11 u'<div class="portlet" id="p-nav">',
12 u'<div class="pBody">',
13 u'<ul id="navibar">',
14 u'<li>%s</li>' % '</li>\n<li>'.join(links),
15 u'</ul>',
16 u'</div>',
17 u'</div>',
18 ]
19 ...
To show parent page, i added this code after line 153:
-- LiDongHa 2005-06-13 16:45:04
Parent page should show in the editbar when needed (unless the author of this theme broke it ).
Problem: When editing, the left menu is moving to the very bottom (On the first glimpse it even looked like the menu is gone at all!). I am using Konqueror 3.3 or Mozilla 1.7.10. -- AndreasHüwel 2005-10-11 08:26:42
- Another problem: if you edit the navi_bar to insert a URL reference to another part of your web site (but outside the Wiki) by using u"[url link title]", the resulting slot in the rendered page does not show the proper link title, and the link itslef is a concatenation of the Wiki address plus the actual URL. This same navi_bar entry displays fine in other themes. And the edit-mode error is still there in version 1.5. . .
Here is a workaround for this URL problem. Find this line (2 places):
- a = wikiutil.link_tag(request, pagename, attrs=attrs)
Change it both times to this. It seems to work for me.
a = u'<a href="%s">%s</a>' % (pagename, link)
Bug(?): The monobook theme (MoinMoin 1.5.2) does not include the common.js javascript code file. I detected that because the MonthCalendar plugin's tooltips don't get displayed. See here.
This bug(?) seems to be still present (2007.09.26), jsmath plugin (http://wiki.themel.com/jsMathParser) doesn't work in monobbok 0.5. Unfortunately the page linked in the comment above is no more active. Anyone has suggestion/instruction on how to enable common.js in monobook?
Bug: I fixed the bad reference to bullet.gif in the monobook.css file. But now even indented paragraphs have a bullet in front of them. See here. You may have a look at my modified theme.
Problem(?): I've downloaded and installed monobook-0.2 and it works just fine until I log out. To log back in, I only get a login link at the top right which references UserPreferences, and the login link at the top right of UserPreferences references...UserPreferences. On the http://moinmoin.wikiwikiweb.de site the top of the page has a centered Login link referencing UserPreferences?action=login, but this is absent from my installation, effectively preventing anyone including myself from logging in unless I add the rather ugly ?action=login to the browser's URL line by hand! What did I do wrong? -- PeterSander - 14-06-06
- Fix to previous problem: I edited the monobook.py file. Under "def username", in the else statement, I basically replicated the code for the 'log out' link which is right above the else statement.
- Adding this to monobook.py fixes the edit mode problem for me:
1 def editorheader(self, d, **kw):
2 """ Assemble wiki header for editor
3
4 @param d: parameter dictionary
5 @rtype: unicode
6 @return: page header html
7 """
8 html = [
9 # Header
10 u'<div id="globalWrapper">',
11 u'<div id="column-content">',
12 self.startPage(),
13 self.msg(d),
14 self.title(d),
15 ]
16 return u'\n'.join(html)
Also I needed to add this to screen.css or monobook.css
/* Fix for a strang bug with textarea within fieldset within float element */ * html #editor-textarea { margin-left:-12.2em; }
Plus changing the beginning of monobook.css like this (the -12.25em is important for IE6 to render it like it should:
#column-content { width: 100%; float: right; margin: 0 0 0.6em -12.25em; padding:0;
monobook for moin >1.5.6
Just uploaded 0.4 version that works with MoinMoin 1.5.x : graphic editor, dynamic toolbox menu, etc. -- JeanMichelGrimaldi 2007-06-30 18:30:00
The rsslink() call needs to be changed to rsslink(d).
Hi! I'd like to add a "What links here?" link to the toolbox on the side. The original theme has that functionality when clicking on the page title. Is it also included in this theme or can it be added somehow? Greetings, alpha (20.07.2007)
- You can add an item which links to a linkto search for current page name. The same feature is available by clicking on the page title.
monobook 0.5 changes
Updated code to include all changes/fixes to make the theme work with moin 1.5.6, Internet Explorer and Firefox. Added an override to the title function, because the title appeared as a bulleted item and if the page started as bullets it threw the viewer (now appears in an <h1>). -- Frank Dowsett 2007-07-31 20:15:00
monobook for moin 1.6?
Any chance we can get this updated for mon 1.6? I've tried it but got error messages:
203925 ERROR AttributeError: 'module' object has no attribute 'getSysPage' Traceback (most recent call last): File "/usr/local/lib/python2.5/site-packages/MoinMoin/request/__init__.py", line 1283, in run handler(self.page.page_name, self) File "/usr/local/lib/python2.5/site-packages/MoinMoin/action/__init__.py", line 239, in do_show content_only=content_only, File "/usr/local/lib/python2.5/site-packages/MoinMoin/Page.py", line 1183, in send_page request.theme.send_footer(self.page_name, print_mode=print_mode) File "/usr/local/lib/python2.5/site-packages/MoinMoin/theme/__init__.py", line 1699, in send_footer request.write(self.footer(d, **keywords)) File "/home/moinmoin/my-wiki/data/plugin/theme/monobook.py", line 60, in footer self.columnone(d), File "/home/moinmoin/my-wiki/data/plugin/theme/monobook.py", line 72, in columnone self.username(d), File "/home/moinmoin/my-wiki/data/plugin/theme/monobook.py", line 302, in username prefpage = wikiutil.getSysPage(request, 'UserPreferences')
-- AdrianBuehlmann 2008-01-18 20:14:17
I've gotten this working with the following two changes to monobook.py
... if more: links.append(titles['__separator__']) # Add more actions (all enabled) for action in more: ## title = Page(request, action).split_title(request, force=1) title = Page(request, action).split_title(request) ## changed # Use translated version if available title = _(title, formatted=False) link = '<li>%s</li>' % wikiutil.link_tag(self.request, \ quotedname + '?action=' + action, title) links.append(link) ... # Set pref page to localized Preferences page attrs = self.extendedAttrs(_('My Preferences'), 'u') ## prefpage = wikiutil.getSysPage(request, 'UserPreferences') prefpage = wikiutil.getLocalizedPage(request, 'UserPreferences') ## changed userlinks.append(prefpage.link_to(request, text=_('Preferences'), attrs=attrs)) ...
-- PeterSander 2025-02-01 22:03:35
If someone updates the theme file, uploading a working version for 1.6.x would be nice. Or at least a diff produced with diff -urN oldfile newfile.
Any chance getting monobook working with IE 6? With the code changes above (2 lines) it's working with 1.6. But the first characters are missing in the editor window -- RalfGross 2008-02-06 09:03:11
Curious - the editor window seems to be ok (in text mode) for me. On the other hand, the page title is missing from the top left of the very first line of the displayed view . Hence the above changes are more of a quick-and-dirty hack to get something to display without crashing under 1.6.0 than a working version. -- PeterSander 2025-02-01 22:03:35
- With IE 6.00.290.xxxx it looks like this:
http://www.stz-softwaretechnik.com/~rg/moin-monobook.jpg -- RalfGross 2008-02-06 16:05:22
I know this comment is not very helpful, but monobook edit displays normally for me in both text and GUI mode under IE7, FireFox, and Opera. --PeterSander 2025-02-01 22:03:35
Change the /moin_static171/monobook/css/msie.css to use MonoBook with IE6:
#editor-textarea { _position:relative; _display:block; _left:163px; }
--ArminWalt 2025-02-01 22:03:35
monobook for moin 1.7
To get UserPreferences/Settings working properly in moin 1.7, I replaced the userlink code with that from the modern theme (see moin-theme-monobook-0.5-moin-1.7.2-compat.patch) -- PaulHowarth 2008-09-10 12:44:00
RufusPollock This patch applied here: https://bitbucket.org/moin/moin-theme-monobook/changeset/8a33055c75fd
monobook for moin 1.9
API changes in moin 1.9 require another patch on top of the 1.7 patch above -- PaulHowarth 2010-01-13 10:54:00
For convenience sake, the fully patched files can be downloaded. Full credit goes to Paul Howarth, who kindly sent me these based on his work. -- GregBarish 2010-04-27 12:03:00
RufusPollock This patch applied here: https://bitbucket.org/moin/moin-theme-monobook/changeset/a5bba01b3b44
As mentioned above I've created a bitbucket repo to track the monobook theme and apply patches. This seems a much better way to maintain these themes than lots of patches -- I will apply all pull requests and will give write to anyone who wants it. RufusPollock http://rufuspollock.org/