diff --git a/data/System/YuiMenuContrib.txt b/data/System/YuiMenuContrib.txt index fbdd497..45de71c 100644 --- a/data/System/YuiMenuContrib.txt +++ b/data/System/YuiMenuContrib.txt @@ -9,22 +9,192 @@ One line description, required for extensions repository catalog. ---++ Usage ----++ Examples +To add a Menu to your Foswiki, add the following to the appropriate place in your Skin. + +%INCLUDE{"%SYSTEMWEB%.YuiMenuContrib"}% + + +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 _currently_ 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]] + +You can then customise the side bar by creating a YuiMenu in %USERSWEB% as detailed below. + +You can also use create other menu's by re-using the concepts in this contrib :) + +---+++ TODO + 1 figure out how to make sub-webs INCLUDE fall back via each of its parent webs + 2 fix the broken side bar / menu when viewing _this_ topic + 3 make a better fallback CSS for when JS is off or broken. + 4 rewrite documentation ---++ Installation Instructions %$INSTALL_INSTRUCTIONS% ----++ Info +---++ Topic selectors that make the three level defaulting work +---+++ Topic menu + +%STARTINCLUDE% +%INCLUDE{ + "%IF{"istopic '%USERSWEB%.YuiMenu'" then="%USERSWEB%.YuiMenu" else="%SYSTEMWEB%.YuiMenuContrib"}%" + MENUWEB="%MENUWEB%" + section="topmenu" +}% +%STOPINCLUDE% + +---+++ 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 USERWEB.DefaultWebMenu topic or +fall back to the MenuContrib's SYSTEM.DefaultWebMenu + + +%STARTSECTION{"webmenu-defaultselector"}% +%INCLUDE{ + "%IF{"istopic '%USERSWEB%.DefaultWebMenu'" then="%USERSWEB%.DefaultWebMenu" else="%SYSTEMWEB%.YuiMenuContrib"}%" + MENUWEB="%MENUWEB%" + section="webmenu" +}% +%ENDSECTION{"webmenu-defaultselector"}% + + + +---++ Top level Menu entries +to define your own WebMenu for all webs, copy and customise the content below to your Web's WebMenu topic +(or to customise the WebMenu for all webs (which don't have a WebMenu topic) copy the text to %USERSWEB%.DefaultWebMenu + +%STARTSECTION{"topmenu"}%
+%ADDTOHEAD{ + "yui-navigation-menu-js" + text="%INCLUDE{"%SYSTEMWEB%.YuiMenuContrib" section="yui-navigation-menu-js-yui"}%" + requires="yui-menu" +}% +
+
+
    + %SEARCH{ + "%HOMETOPIC%" + recurse="off" + scope="topic" + web="all" + nonoise="on" + format="
  • [[$web.%HOMETOPIC%][$web]] +
    + $percntINCLUDE{ + $quot$web.WebMenu$quot + MENUWEB=$quot$web$quot + warn=$quot$percntINCLUDE{$quot%SYSTEMWEB%.YuiMenuContrib$quot MENUWEB=$quot$web$quot section=$quotwebmenu-defaultselector$quot}$percnt$quot + }$percnt +
    +
  • " + }% +
+
+
+
%ENDSECTION{"topmenu"}% +
-Many thanks to the following sponsors for supporting this work: - * Acknowledge any sponsors here +---++ !WebMenu Selector +to define your own !WebMenu for all webs, copy and customise the content below to your Web's !WebMenu topic +(or to customise the !WebMenu for all webs (which don't have a !WebMenu topic) copy the text to %USERSWEB%.DefaultWebMenu + +__ADVANCED:__ To add sub menus into the webmenu, you need to add =
= +around another level of bullet lists (unfortuanatly, these must be HTML not TML) + + +%STARTSECTION{"webmenu"}% + * [[%SCRIPTURLPATH{"view"}%/%MENUWEB%/WebCreateNewTopic?topicparent=%BASETOPIC%][ %MAKETEXT{"Create New Topic"}%]] + * [[%MENUWEB%.WebTopicList][ %MAKETEXT{"Index"}%]] + * [[%MENUWEB%.WebSearch][ %MAKETEXT{"Search"}%]] +
    +
  • [[%MENUWEB%.WebSearchAdvanced][Advanced %MAKETEXT{"Search"}%]]
  • +
+ * [[%MENUWEB%.WebChanges][%MAKETEXT{"Changes"}%]] + * [[%MENUWEB%.WebNotify][ %MAKETEXT{"Notifications"}%]] + * [[%MENUWEB%.WebRss][ %MAKETEXT{"RSS Feed"}%]] + * [[%MENUWEB%.WebStatistics][ %MAKETEXT{"Statistics"}%]] + * [[%MENUWEB%.WebPreferences][ %MAKETEXT{"Preferences"}%]] +%ENDSECTION{"webmenu"}% +
+ + + +---++ YUI JS and CSS sections +---++++ YUI support + +%STARTSECTION{"yui-navigation-menu-js-yui"}% + +%ADDTOHEAD{ + "yui-menu" + requires="yui-menu-js, yui-menu-css" + text="" +}% +%ADDTOHEAD{ + "yui-menu-js" + text=" + + " +}% +%ADDTOHEAD{ + "yui-menu-css" + text="" +}% +%ENDSECTION{"yui-navigation-menu-js-yui"}% + + + +---++ Info -| Author(s): | | -| Copyright: | © | +| Author(s): | Foswiki:Main.SvenDowideit | +| Copyright: | © SvenDowideit@fosiki.com | | License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] | | Version: | %$VERSION% | | Change History: |   | +| 12 Jan 2008: | initial release | | Dependencies: | %$DEPENDENCIES% | | Home page: | http://foswiki.org/bin/view/Extensions/YuiMenuContrib | diff --git a/lib/Foswiki/Contrib/YuiMenuContrib/MANIFEST b/lib/Foswiki/Contrib/YuiMenuContrib/MANIFEST index 351a52c..49d72e0 100644 --- a/lib/Foswiki/Contrib/YuiMenuContrib/MANIFEST +++ b/lib/Foswiki/Contrib/YuiMenuContrib/MANIFEST @@ -1,4 +1,5 @@ # Release manifest for YuiMenuContrib data/System/YuiMenuContrib.txt 0644 Documentation lib/Foswiki/Contrib/YuiMenuContrib.pm 0644 Perl module +templates/viewsidebar.pattern_yuimenu.tmpl 0644 pattern skin template to get sidebar to use our menu diff --git a/templates/viewsidebar.pattern_yuimenu.tmpl b/templates/viewsidebar.pattern_yuimenu.tmpl new file mode 100644 index 0000000..e573dc4 --- /dev/null +++ b/templates/viewsidebar.pattern_yuimenu.tmpl @@ -0,0 +1,8 @@ +%TMPL:INCLUDE{viewsidebar}% + +%{ Please note that there must be a new line before the include of the WebLeftBar. Other wise the first bullet will not be displayed as a bullet. See Foswiki task Item410 }% +%TMPL:DEF{"websidebar"}%%TMPL:P{"sidebar:webindicator"}% +%INCLUDE{"%SYSTEMWEB%.YuiMenuContrib"}% +%TMPL:END% + +