Description
Long quicklinks get truncated and are hardly readable especially for sidebar-themes.
Steps to reproduce
Add a page name with more than 25 chars to your quicklinks.
Details
This Wiki. All themes are affected.
MoinMoin Version |
moin-1.5.4 |
Workaround
Patch MoinMoin/themes/__init__.py to use shortenPagename-method for links in navibar (patch generated in local svn repos: rev.100 corresponds to moin-1.5.4-release):
{{{Index: C:/Sources/moin-aca-trunk/MoinMoin/theme/init.py
=================================================================== --- C:/Sources/moin-aca-trunk/MoinMoin/theme/init.py (revision 100) +++ C:/Sources/moin-aca-trunk/MoinMoin/theme/init.py (revision 101) @@ -278,7 +278,7 @@
from MoinMoin import config for scheme in self.linkSchemas:
- if pagename.startswith(scheme):
- title = wikiutil.escape(title) + title = self.shortenPagename(wikiutil.escape(title))
link = '<a href="%s">%s</a>' % (pagename, title) return pagename, link
@@ -292,7 +292,7 @@
- thiswiki = request.cfg.interwikiname if interwiki == thiswiki:
- pagename = page
- title = page + title = self.shortenPagename(page)
- else:
- return (pagename,
- self.request.formatter.interwikilink(True, interwiki, page) +
- return (pagename,
}}}
- Another way to handle this "bug" (if moin itself will be not changed which seems to be the current plan): override the method "splitNavilink" in your theme.
Discussion
- What is the official opinion on this one? If the patch is not accepted because long names are OK for the modern theme, it would be nevertheless worthwhile adding an optional argument in order to reduce the length of the quicklinks for sidebar themes.
It is just incorrectly filed (rather a patch/feature request, not a hard bug). Besides the incorrect order of function calls in the first patch hunk (it needs to be escaped after shortening it), it looks ok. It does not meet our PatchPolicy, though. -- AlexanderSchremmer 2006-10-09 18:37:47
- Patch was uploaded a while ago when 1.5.4 was current. ...if that was the point.
If "Long quicklinks get truncated and are hardly readable", then why do you want to truncate the title?
- Because they don`t fit into the sidebar of the right-sidebar theme and it's even worth with left sidebar themes.
This theme-specific problem can be solved in the theme by overriding the splitNavilink-method (e.g. as done in DavidLinke/Sinorca4Moin. So it is not a real moin bug.
Plan
- Priority:
- Assigned to:
- Status: 1.6 shortens long quicklinks