You are here:
STALklubben
>
System Web
>
YuiMenuContrib
(2009-04-02,
WikiGuest
)
(raw view)
E
dit
A
ttach
---+!! !YuiMenuContrib <!-- One line description, required for extensions repository catalog. * Set SHORTDESCRIPTION = add a Menu (with popup sub menus) to your Foswiki --> %SHORTDESCRIPTION% %TOC% ---++ Usage This Contrib allows you to add the dynamic Javascript menu from YahooUserInterfaceContrib - see http://developer.yahoo.com/yui/menu/ In WidgetsSkin, add a new widget to yout %SYSTEMWEB%.DefaultWidgets topic and then add that to the Design topic you are using. In PatternSkin, it is easiest to add =pattern_yuimenu= to the SKIN setting eg =Set SKIN=pattern_yuimenu,pattern= in your %MAINWEB%.SitePreferences. To try it out, add =?skin=pattern_yuimenu,pattern= to the end of your URL - * eg [[%SCRIPTURL{view}%/%BASEWEB%/%HOMETOPIC%?skin=pattern_yuimenu,pattern][try me using pattern skin]] Or add a Menu to your Foswiki, add the following to the appropriate place in your Skin. <verbatim> %INCLUDE{"%SYSTEMWEB%.YuiMenuContrib"}% </verbatim> You can customise each web's menu by copying the %SYSTEMWEB%.DefaultWebMenu topic into the WebMenu topic in the web you wish to customise. You can also customise the entire side bar by creating a SiteMenu in %USERSWEB% by copying the %SYSTEMWEB%.DefaultMenu topic (requires advances TML knowledge). ---++ Installation Instructions You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server. Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install". If you have any problems, or if the extension isn't available in =configure=, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help. ---++ Topic selectors that make the three level defaulting work ---+++ Topic menu <verbatim> %STARTINCLUDE% %INCLUDE{ "%IF{"istopic '%USERSWEB%.SiteMenu'" then="%USERSWEB%.SiteMenu" else="%SYSTEMWEB%.DefaultMenu"}%" MENUWEB="%MENUWEB%" section="topmenu" }% %STOPINCLUDE% </verbatim> ---+++ WebMenu defaulting This way, SideBarMenu can INCLUDE the $web.WebMenu if it exists, or (using warn=) fall back to this topic, which will use the customised %USERSWEB%.DefaultWebMenu topic in the %USERSWEB% or fall back to the default in this topic <verbatim> %STARTSECTION{"webmenu-defaultselector"}% %INCLUDE{ "%WEB%.%TOPIC%" MENUTOPIC="%IF{"istopic '%USERSWEB%.DefaultWebMenu'" then="%USERSWEB%.DefaultWebMenu" else="%SYSTEMWEB%.YuiMenuContrib"}%" MENUWEB="%MENUWEB%" section="webmenu-builder" }% %ENDSECTION{"webmenu-defaultselector"}% </verbatim> <verbatim> %STARTSECTION{"webmenu-builder"}%<ul> %SEARCH{ "^\|.*\|$" web="%MENUWEB%" topic="%MENUTOPIC%" type="regex" multiple="on" casesensitive="on" nonoise="on" separator="" format="$percntINCLUDE{ $quot%WEB%.%TOPIC%$quot MENUWEB=$quot%MENUWEB%$quot MENUTOPIC=$quot$pattern(^\|\s*([^\|\s]*)\s*\|.*)$quot MENULABEL=$quot$pattern(^\|\s*[^\|\s]*\s*\|\s*([^\|]*)\s*\|.*)$quot section=$quot$pattern(^\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*([^\|\s]*)\s*\|.*)$quot EXTRA=$quot$pattern(^\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*[^\|\s]*\s*\|([^\|]*)\|.*)$quot SUBMENUWEB=$quot$pattern(^\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*[^\|\s]*\s*\|\s*([^\|\s]*)\.[^.]*\s*\|.*)$quot SUBMENUTOPIC=$quot$pattern(^\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*[^\|\s]*\s*\|\s*[^.]*\.([^\|\s]*)\s*\|.*)$quot }$percnt" }% %IF{"'%MENUWEB%.%MENUTOPIC%' allows 'EDIT'" then="<li class='menu-edit-link'>[[%MENUWEB%.%MENUTOPIC%][edit menu]]</li>"}% </ul>%ENDSECTION{"webmenu-builder"}% %STARTSECTION{"element"}%<li>[[%MENUTOPIC%][%MENULABEL%]]</li>%ENDSECTION{"element"}% %STARTSECTION{"submenu"}%<li>[[%MENUTOPIC%][%MENULABEL%]] <div class='yuimenu'><div class='bd'> %INCLUDE{ "%WEB%.%TOPIC%" section="webmenu-builder%IF{"istopic '%SUBMENUWEB%.%SUBMENUTOPIC%'" then="" else="-default"}%" MENUWEB="%SUBMENUWEB%" MENUTOPIC="%SUBMENUTOPIC%" }% </div></div> </li>%ENDSECTION{"submenu"}% %STARTSECTION{"html"}%<li>[[%MENUTOPIC%][%MENULABEL%]] <div class='yuimenu'><div class='bd'> %EXTRA% </div></div> </li>%ENDSECTION{"html"}% %STARTSECTION{"webmenu-builder-default"}%<ul> %SEARCH{ "^\|.*\|$" web="%IF{"istopic '%MAINWEB%.DefaultWebMenu'" then="%MAINWEB%" else="%SYSTEMWEB%"}%" topic="DefaultWebMenu" type="regex" multiple="on" casesensitive="on" nonoise="on" separator="" format="$percntINCLUDE{ $quot%WEB%.%TOPIC%$quot MENUWEB=$quot%MENUWEB%$quot MENUTOPIC=$quot$pattern(\|\s*([^\|\s]*)\s*\|.*)$quot MENULABEL=$quot$pattern(\|\s*[^\|\s]*\s*\|\s*([^\|]*)\s*\|.*)$quot section=$quot$pattern(\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*([^\|\s]*)\s*\|.*)$quot SUBMENUWEB=$quot$pattern(\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*[^\|\s]*\s*\|\s*([^\|\s]*)\.[^.]*\s*\|.*)$quot SUBMENUTOPIC=$quot$pattern(\|\s*[^\|]*\s*\|\s*[^\|]*\s*\|\s*[^\|\s]*\s*\|\s*[^.]*\.([^\|\s]*)\s*\|.*)$quot }$percnt" }% %IF{"'%MENUWEB%.%MENUTOPIC%' allows 'EDIT'" then="<li class='menu-edit-link'>[[%SCRIPTURL{save}%/%MENUWEB%/%MENUTOPIC%?templatetopic=%IF{"istopic '%MAINWEB%.DefaultWebMenu'" then="%MAINWEB%" else="%SYSTEMWEB%"}%.DefaultWebMenu][create menu]]</li>"}% </ul>%ENDSECTION{"webmenu-builder-default"}% </verbatim> ---++ YUI JS and CSS sections ---++++ YUI support <verbatim> %STARTSECTION{"yui-navigation-menu-js-yui"}%<script type='text/javascript' > YAHOO.util.Event.onContentReady('yui-navigation-menu', function () { /* Instantiate a Menu: The first argument passed to the constructor is the id of the element in the page representing the Menu; the second is an object literal of configuration properties. */ var oMenu = new YAHOO.widget.Menu('yui-navigation-menu', { position: 'static', hidedelay: 750, lazyload: true }); /* Call the 'render' method with no arguments since the markup for this Menu instance is already exists in the page. */ oMenu.render(); }); </script> <style> .yui-skin-sam .yuimenu .bd { border: 0px; padding: 0px; } /* hide foswiki tml created p's */ .bd p { display:none; } .yui-skin-sam .yuimenuitem-selected { background-color: #f5f5f5; } .yui-skin-sam .yuimenuitemlabel { color:#000000; cursor:default; padding:10px; text-decoration:none; } .yui-skin-sam .foswikiNewLink { border: 0px; } /* need to over-ride the overflow in Pattern Skin */ #patternSideBar { overflow:visible; } .yui-skin-sam .menu-edit-link .yuimenuitemlabel { padding-bottom:0; padding-top:0; text-align:right; } .yui-skin-sam .menu-edit-link .yuimenuitemlabel :link:hover { color: darkblue; } /* so that JS off displays all menu elements */ .yuimenu .yuimenu, .yuimenubar .yuimenu { position:inherit; } /* IE6 fix */ .yui-skin-sam .yuimenu .yuimenuitemlabel { _zoom: 1; } .yui-skin-sam .yuimenu .yuimenu .yuimenuitemlabel { _zoom: normal; } </style> %ADDTOHEAD{ "yui-menu" requires="yui-menu-js, yui-menu-css" text="" }% %ADDTOHEAD{ "yui-menu-js" text="<script type='text/javascript' src='%PUBURL%/%SYSTEMWEB%/YahooUserInterfaceContrib/build/yahoo-dom-event/yahoo-dom-event.js'></script> <script type='text/javascript' src='%PUBURL%/%SYSTEMWEB%/YahooUserInterfaceContrib/build/container/container_core.js'></script> <script type='text/javascript' src='%PUBURL%/%SYSTEMWEB%/YahooUserInterfaceContrib/build/menu/menu.js'></script>" }% %ADDTOHEAD{ "yui-menu-css" text="<link rel='stylesheet' type='text/css' href='%PUBURL%/%SYSTEMWEB%/YahooUserInterfaceContrib/build/menu/assets/skins/sam/menu.css'>" }% %ENDSECTION{"yui-navigation-menu-js-yui"}% </verbatim> ---++ Info | Author(s): | Foswiki:Main.SvenDowideit | | Copyright: | © SvenDowideit@fosiki.com | | License: | [[http://www.gnu.org/licenses/gpl.html][GPL 3 (Gnu General Public License)]] | | Version: | 3364 (2009-04-02) | | Change History: | <!-- versions below in reverse order --> | | 2 April 2009: | fix spelling mistake in create menu link | | 18 March 2009: | add css element for parent nodes of currently selected node - and make grey | | 9 March 2009: | change the WebMenu topic format to be a table to simplify editing | | 4 March 2009: | fix IE6 rollover | | 12 Jan 2009: | initial release | | Dependencies: | <table class="foswikiTable" border="1"><tr><th>Name</th><th>Version</th><th>Description</th></tr><tr><td align="left">Foswiki::Contrib::YahooUserInterfaceContrib</td><td align="left">>=0</td><td align="left">uses YahooUserInterfaceContrib</td></tr></table> | | Home page: | http://foswiki.org/bin/view/Extensions/YuiMenuContrib | <!-- Do _not_ attempt to edit this topic; it is auto-generated. -->
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2009-04-02 - 12:08:21 -
WikiGuest
System
Internetbokning
Log In
(ej för bokning) or
Register
Toolbox
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
User Reference
BeginnersStartHere
TextFormattingRules
Macros
FormattedSearch
QuerySearch
DocumentGraphics
SkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
SiteTools
DefaultPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Webs
Main
STALklubben
Sandbox
System
Deutsch
English
Svenska
Copyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding STALklubben?
Send feedback