This question about Using an extension: Answered

Content from System Web rendered into sidebar

In my foswiki every content in the system web is rendered into the sidebar - the main window ist empty.

I'm using nat skin and have made a SiteSideBar to get some more navigation items into the sidebar - which works in every web, but not in System. Do you have any hint, where I should look into?

-- MichaelLorenzen - 05 May 2023

Would you like to share your side bar code?

-- MichaelDaum - 05 May 2023

Sure, this is Main.SiteSideBar:

---+!! %TOPIC%

Default %TOPIC% component is at [[%SYSTEMWEB%.%TOPIC%]] - this is our local definition including treeview/treebrowser.
<verbatim class='tml'>
%STARTINCLUDE%<!-- -->
%TMPL:P{"sidebar::header"}%<!-- -->
%TREEBROWSER{ theme="file" shared="tree" title="" openTo="0" noroot="true" }%
%TREE{ formatting="outline" format="   * $topic" levelprefix="   " excludetopic="Web*"}% 
%TMPL:P{"sidebar::links"}%<!-- -->
%TMPL:P{"sidebar::mysidebar"}%<!-- -->
%TMPL:P{"sidebar::tools"}%<!-- -->
<!-- -->%STOPINCLUDE%</verbatim>

-- MichaelLorenzen - 05 May 2023

System.SiteSideBar is unchanged

-- MichaelLorenzen - 05 May 2023

Try adding the parameter web="%BASEWEB%"= to %TREE{}%

-- MichaelDaum - 05 May 2023

This does not help.

I tried to look deeper behind this error and found, that TREEBROWSER gives a JavaScript-Error in System Web, and only there.

My (maybe temporary) fix is to exclude TREE/TREEBROWSER in System Web, because I mostly need it in the content webs:
%IF{"web!='%SYSTEMWEB%'" then="$percentTREEBROWSER{ theme=\"file\" shared=\"tree\" title=\"\" openTo=\"0\" noroot=\"true\" }$percent" else=""}%
%IF{"web!='%SYSTEMWEB%'" then="$percentTREE{ formatting=\"outline\" format=\"   * $topic\" levelprefix=\"   \" excludetopic=\"Web*\" }$percent " else=""}%

Do you know a somewhat more elegant solution?

-- MichaelLorenzen - 08 May 2023

After looking a bit more into it and the JavaScript-Error I found the source of the problem:

The browser development tools showed this Error:

tree.add(502,0,"<a href=\"/fw/System/NewLdapUserTemplate\">%EXPAND{\"$percntLDAP{\\"sAMAccountName=$percntUSERNAME$percnt\\" format=\\"$dollardisplayName\\"}$percnt\"}%</a>",'','','','/fw/pub/System/TreeBrowserPlugin/page.gif');

The source is the topic NewLdapUserTemplate, which has this setting:
   <nop>* Local TOPICTITLE = %EXPAND{"$percntLDAP{\"sAMAccountName=$percntUSERNAME$percnt\" format=\"$dollardisplayName\"}$percnt"}%

which is rendered as topic title by the search in TREE and lets TREEBROWSER s JavaScript fail. This seems to break page rendering while in SideBar, and every following content is written into it.

Excluding NewLdapUserTemplate from the TREE search also solves the problem:

excludetopic="Web*, NewLdapUserTemplate"

So it is more a problem of LDAPContrib or TREEBROWSER, I suppose?

-- MichaelLorenzen - 08 May 2023

Excluding NewLdapUsersTemplate sounds perfect.

-- MichaelDaum - 09 May 2023
 

QuestionForm edit

Subject Using an extension
Extension NatSkin
Version Foswiki 2.1.6
Status Answered
Related Topics
Topic revision: r7 - 09 May 2023, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy