ShUIE MOSS Wiki ToC links go to wiki pages not the right place?

Feb 19, 2010 at 7:47 PM

Hoping that I can get some help here.

My team has installed the newest version of the ShUIE and we are specifically interesting in using the MOSS Wiki ToC feature.  However, when the ToC appears (because of the increased font size or changed font color) with the links for each segment in place, when you click on those ToC links they take you to the listing of wiki pages.... not to the segment in the wiki page.

I find this to be problematic and not the correct function of a wiki ToC.

Has anyone discovered the same problem or do they have any suggestions on trouble shooting?

Thank you.

May 3, 2010 at 12:56 PM

Yes I have found the solution.

There was an Issue with the javascript code. Reinstall the themplate with the following content and you should be fine. Works for me

<?xml version="1.0" encoding="UTF-8"?>
<shuie order="50" active="true">
  <title><![CDATA[Wikis]]></title>
  <contexts>
    <context active="true">
      <baseTemplate><![CDATA[119]]></baseTemplate>
        <pageMode>
        <invalid>true</invalid>
      </pageMode>
    </context>
  </contexts>
   <javascript minify="true">
    <code>
      <![CDATA[
$(document).ready(function(){
  $(".ms-wikicontent div").prepend("<table id=wikiToc />");
  
  $("#wikiToc")
    .append("<thead id=wikiTocHead />")
    .append("<tbody />")
    .addClass("ms-propertysheet")
    .addClass("ms-bodyareaframe")
    .css("float","right")
    .css("width","150px")
    .css("height","auto")
    .css("font-size","1em")
    .css("padding","2px")
    .css("margin-left","10px")
    .css("margin-right","0")
    .css("margin-bottom","10px");
 
  $("#wikiToc tbody").append("<tr />");
  $("#wikiToc tbody tr").append("<td />");
  $("#wikiToc tbody tr td").append("<div id=wikiTocContainer />");
  $("#wikiTocContainer")
    .css("padding","10px;")
    .append("<ul id=wikiTocBody />");
   
  $("#wikiTocHead")
    .html("<tr><th>Table of Contents</th></tr>");

  var wikiTocId = 0;
  $(".ms-wikicontent font").each(function() {
    var element = $(this);
   
    if (!$.trim(element.text()))
      return;
   
    wikiTocId++;
    element.prepend("<a name='toc" + wikiTocId + "'></a>");
 
    var liopen = "";
    var liclose = "";
    for (var ii = element.attr("size"); ii < 7; ii++) {
  liopen = liopen + "<ul>";
  liclose = liclose + "</ul>";
    }
 
    $("#wikiTocBody")
   .append(
     liopen +
     "<li><a class='ms-wikicontent ms-wikilink' href='#toc" + wikiTocId + "'>" +
     element.text() +
     "</a></li>" +
     liclose
   );
   
    $("#wikiTocContainer ul")
      .css("list-style-type","circle")
      .css("margin","0")
      .css("margin-left","1em")
      .css("padding","0")
      .css("text-indent","0")
      .css("line-height","1");
  });
 
});
      ]]>
    </code>
  </javascript>
</shuie>