[Pmwiki-users] wiki-formatting of included wiki-pages

Knut Alboldt alboldt
Mon May 24 14:17:53 CDT 2004


Hi !

I want to use the directive "=groupsidebar:"+groupname to include a 
wiki-page into the active SideBar with "*"-lines formatted as wiki-text
(like a conditional [[include:ThisGroup:SideBar]] )

SideBar-pagefile:
------------------------
* Item 1
* item 2
=groupsidebar:Testing
* item 3

file Testing.SideBar to be included:
--------------------------
** item 1.1
** item 1.2
** item 1.3

should be formatted like one text in the displayed output:
----------------------------------------------------------------------------------
* Item 1
* item 2
** item 1.1
** item 1.2
** item 1.3
* item 3

but it displays rather like if the following text is the input:
---------------------------------------------------------------------------------
* Item 1
* item 2
** item 1.1 ** item 1.2 ** item 1.3
* item 3


so the include file is treated as only one line, not as multiple (athough 
the linefeeds are in the text when the fiel is read)

used PHP-code:
------------------------

$DoubleBrackets['/^=groupsidebar:(.*)/e'] = 'GroupSideBar("$1","$pagename")';

function GroupSideBar($groupsidebarname,$pagename)
{
   $group = FmtPageName('$Group',$pagename);
   if ($group==$groupsidebarname) # include group's sidebar file if the 
current group name matches the specified sidebar's group name
   {
     $inclpage = ReadPage("$group.SideBar";);
     if ($inclpage) { return $inclpage['text']; }
     else { return '** NEW GSB {{'.$group.'/SideBar}}'; } # just to enable 
a page-creation link
   }
   else return "";
}

used pmwiki 0.6.18

where is the error ? 




More information about the pmwiki-users mailing list