WIKI Page with TOC and Search

LabKey Support Forum (Inactive)
WIKI Page with TOC and Search jonesga  2014-06-19 08:07
Status: Closed
 
I reviewed the forum and it appears this was last discussed in 2011. Have there been any changes. I need to use the WIKI Pages with JAVAScipt and want the full page to display.

Thanks
 
 
adam responded:  2014-06-19 13:37
You can embed the Wiki Table Of Contents and Search webparts into any wiki (or message) that uses HTML format using our substitution syntax. As an example, create an HTML wiki with this source:

  ${labkey.webPart(partName='Wiki Table of Contents', showFrame='false')}
  ${labkey.webPart(partName='Wiki TOC', showFrame='false')}
  ${labkey.webPart(partName='Search', showFrame='false', location='right', includeSubFolders='false')}

https://www.labkey.org/wiki/home/Documentation/page.view?name=include

You can also use the LABKEY.WebPart() client API to dynamically AJAX webparts into an HTML page:

  <div id='tocDiv'/><br/>
  <div id='searchDiv'/>
  <script type="text/javascript">
    var tocRenderer = new LABKEY.WebPart({
        partName: 'Wiki TOC',
        renderTo: 'tocDiv'
        })
    tocRenderer .render();

    var tocRenderer = new LABKEY.WebPart({
        partName: 'Search',
        renderTo: 'searchDiv'
        })
    tocRenderer .render();
  </script>

https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.WebPart.html

Adam