Create a personalized sidebar navigation

Select a sidebar template:


%STARTSECTION{"checkexists"}%
%IF{"istopic '%TMPL:P{"thesidebar"}%'"
   then="$percntINCLUDE{\"%BASEWEB%.%BASETOPIC%\" section=\"deletesidebarform\"}$percnt"
   else="$percntINCLUDE{\"%BASEWEB%.%BASETOPIC%\" section=\"newsidebarform\"}$percnt"
}%
%ENDSECTION{"checkexists"}%

%STARTSECTION{"deletesidebarform"}%
<div class='foswikiWarningMessage'>
  The sidebar topic %TMPL:P{"thesidebar"}% already exists. 
</div>

<form action="%SCRIPTURLPATH{"rename"}%/%TMPL:P{"thesidebar"}%" method="post" id="deletesidebarform">
  <input type="hidden" name="newweb" value="%TRASHWEB%" />
  <input type="hidden" name="newtopic" value="%WIKINAME%%IF{"defined 'MYSIDEBAR'" then="%MYSIDEBAR%" else="SideBar"}%%GMTIME{"$epoch"}%" />
  <input type="hidden" name="redirectto" value="%BASEWEB%.%BASETOPIC%" />
  <input type="hidden" name="nonwikiword" value="on" />
<div class="foswikiFormSteps">
  <div class="foswikiFormStep">
    %MAKETEXT{"Do you want to *delete* the old sidebar and then create a new one?"}%
  </div>
  <div class="foswikiFormStep foswikiFormLast foswikiFormButtons">
    %BUTTON{"%MAKETEXT{"Yes, delete"}%" type="save" icon="bin"}%
    %BUTTON{"%MAKETEXT{"No, thanks"}%" icon="cross" target="%TMPL:P{"thesidebar"}%"}%
    %CLEAR%
  </div>
</div>
</form>
%ENDSECTION{"deletesidebarform"}%

%STARTSECTION{"newsidebarform"}%
<div class="foswikiFormSteps natMySideBarForm">
<form action="%SCRIPTURLPATH{"save"}%/%TMPL:P{"thesidebar"}%" method="post" id="sidebarform">
<input type="hidden" name="t" value="%GMTIME{"$epoch"}%" />
<input type="hidden" name="topicparent" value="%WIKINAME%" />
<input type="hidden" name="redirectto" value="%SCRIPTURL{"view"}%/%BASEWEB%/%BASETOPIC%?section=success" />
<input type="hidden" name="Unset+TOPICTITLE" value="on" />
<div class="foswikiFormStep">
  <h3>Select a sidebar template:</h3>

<noautolink>
  %SEARCH{".*SideBarTemplate" 
    scope="topic"
    type="regex"
    nonoise="on"
    format="<input type='radio' id='$web_$topic_template' name='templatetopic' value='$web.$topic' class='foswikiRadioBox required'/>
      <label for='$web_$topic_template'> 
        $percntTOPICTITLE{\"$topic\"}$percnt
        (<a href='%SCRIPTURLPATH{"view"}%/$web/$topic' target='_blank' title='%MAKETEXT{"open [_1]" args="<nop>$topic"}%'>?</a>)
      </label><br />" 
  }%
  <input type='radio' id='empty_template' name='templatetopic' value='' class='foswikiRadioBox required'/>
  <label for='empty_template'>
    %MAKETEXT{"no template"}%
  </label>
</noautolink>
  <label for='templatetopic' class='error' style='display:none'>Please select a template.</label>
</div>
<div class="foswikiFormStep foswikiFormLast foswikiFormButtons">
%BUTTON{"%MAKETEXT{"Save"}%" icon="disk" type="save"}%
%CLEAR%
</div>
</form>
</div>

%JQREQUIRE{"validate"}%
%ADDTOZONE{
  "script"
  id="sidebarform"
  text="<script type='text/javascript'>
    (function($) {
      $(function() {
        $('#sidebarform').validate();
      });
    })(jQuery);
  </script>"
  requires="JQUERYPLUGIN::VALIDATE"
}%
%ENDSECTION{"newsidebarform"}%

%TMPL:DEF{PROMPT:mysidebarbookmark}%<!-- mysidebarbookmark:prompt -->
<input type="hidden" name="bookmark_web" value="%BASEWEB%" />
<input type="hidden" name="bookmark_topic" value="%BASETOPIC%" />
<input type="hidden" name="redirectto" value="%BASEWEB%.%BASETOPIC%" />
<input type="hidden" name="endPoint" value="%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%" />
%BUTTON{
  "%MAKETEXT{"Add to sidebar"}%"
  icon="add" 
  class="jqButtonSimple"
  type="submit" 
  style="width:99%" 
  title="%MAKETEXT{"Add topic [_1] to my sidebar navigation" args="<nop>%BASETOPIC%"}%"
}%
%CLEAR%
<!-- //mysidebarbookmark:prompt -->%TMPL:END%

%TMPL:DEF{OUTPUT:mysidebarbookmark}%   * [[%URLPARAM{"bookmark_web"}%.%URLPARAM{"bookmark_topic"}%][%URLPARAM{"bookmark_topic"}%]]%POS:AFTER%
%TMPL:END%


%STARTSECTION{"success"}%
---+ Create a personalized sidebar navigation
<div class='foswikiSuccessMessage'>You successfully created your sidebar at %TMPL:P{"thesidebar"}%.</div>
%ENDSECTION{"success"}%
Topic revision: r1 - 06 Apr 2021, UnknownUser
This site is powered by FoswikiCopyright &© by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Wiki_Virgo_LSC? Send feedback