SID-02036: WebTopMenu display problem with custom menu
| Status: |
Answered |
TWiki version: |
6.0.1 |
Perl version: |
5.14.2 |
| Category: |
CategorySkin |
Server OS: |
Debian Linux 7.8 |
Last update: |
10 years ago |
We're using the following to add a dropdown list to the top menu bar (a list of all pages with ClientSpecificPage as their parent):
%INCLUDE{%SYSTEMWEB%.TopMenuSkinTopicMenu}%
* [[TCL.ClientSpecificPages][ Client Pages %ICON{menu-down}%]]
%TREEBROWSER{"file" title="%WEB%" noroot="true" noindent="true"}%
%TREEVIEW{web="TCL" topic="ClientSpecificPages" formatting="ullist" format=" * $topic" levelprefix=" " startlevel="1" stoplevel="1"}%
%STOPINCLUDE%</div>
It works fine, but the "T" at the left hand end and the "Account" at the right hand end of the menubar are slightly lower (see attached image):
Any thoughts as to why that may be?
--
Keith Edmunds - 2015-03-18
Discussion and Answer
Not sure. I suspect that the TREEBROWSER and TREEVIEW interject something else besides the bullets, possibly a div. Look at the generated HTML to see. If so check parameters to the tree variables to suppress the extra stuff.
--
Peter Thoeny - 2015-03-18
Good catch, Peter. TREEVIEW has a 'nodiv' option (which, bizarrely, has to be set to "2") - but that's revealed what I suspect is a bug in the TREEBROWSER plugin.
Without 'nodiv', part of the generated HTML is:
<noscript>
<div class="treePlugin">
</noscript>
<ul>
<li> ...
That's odd anyway - why would the div definition be inside noscript tags? But even odder is the generated HTML with nodiv="2":
<noscript>
<ul>
</noscript>
<li> ...
That means that the opening
<ul> is not seen on browsers with JS enabled.
The noscript wrapper is generated at the very end of
TreeBrowserPlugin.pm, but I'm pretty sure that's buggy (my Perl isn't up to being more sure than that).
Thoughts?
--
Keith Edmunds - 2015-03-18
The bug could be an artifact of
formatting="ullist", e.g. you are mixing HTML and TML. Better to output TML bullets and let TWiki render this as a bullet, then menu item.
But: Why use TREEBROWSER and TREEVIEW? I'd simply do a
FormattedSearch that identifies all topics who's parent is "ClientSpecificPages".
--
Peter Thoeny - 2015-03-19
I fixed a bug in the
TreePlugin, see
TWikibug:Item7626
.
--
Peter Thoeny - 2015-03-19
Moved to
FormattedSearch, which is a much better solution (thank you). For the benefit of anyone reading this later, this is what I did:
%INCLUDE{%SYSTEMWEB%.TopMenuSkinTopicMenu}%
* [[TCL.ClientSpecificPages][ Client Pages %ICON{menu-down}%]]
%SEARCH{"parent.name = 'ClientSpecificPages'" web="TCL" type="query"
nosearch="on"
nototal="on"
format=" * [[$topic]]"
}%
%STOPINCLUDE%</div>
I updated the installed
TreePlugin, but I still see the <ul> inside the script tags. However, as I'm no longer using TREEBROWSER and TREEVIEW for this, the problem doesn't affect me. I'll close this bug.
Thanks for your help, Peter.
--
Keith Edmunds - 2015-03-19
I am glad it worked out with the formatted search.
The TREEVIEW should work too, but you need to remove
formatting="ullist" to avoid mixing HTML bullets and TML bullets. You also need to remove the TREEBROWSER.
--
Peter Thoeny - 2015-03-19
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.