<div>Hans,</div> <div> </div> <div>I cut and pasted your exact syntax into my config.php and something is not correct on my side..</div> <div> </div> <div>The only thing that show up on my page is the syntax. I also downloaded the Grep.php and I am having the same results. Does somthing need to be enable at the server level for this to work?</div> <div> </div> <div>In my config I placed the following at the end</div> <div>####Test GREP<BR>include_once("$FarmD/cookbook/grep.php");</div> <div> </div> <div>and</div> <div>$MarkupExpr['textrows'] = 'ExtractTextRows($pagename, @$args[0],<BR> @$args[1])';<BR>function ExtractTextRows($pagename, $str, $source) {<BR> if ($str=='' || $source=='') return '';<BR> $pn = MakePageName($pagename, $source);<BR> if ($pn==$pagename) return
'';<BR> $page = RetrieveAuthPage($pn, 'read', true);<BR> $text = $page['text'];<BR> $section = TextSection($text, $source);<BR> $textrows = explode("\n",$section);<BR> $newrows = array();<BR> foreach ($textrows as $row) {<BR> if (strstr($row, $str))<BR> $newrows[] = $row;<BR> }<BR> return implode("\n", $newrows);<BR><BR></div> <div> </div> <div>My Syntax:</div> <div>{(grep Complete <SPAN
class=wikiword>Wiki.TestA</SPAN> suffix=STRING )} </div> <div class=vspace> </div> <div class=vspace>{(textrows Complete <SPAN class=wikiword>Wiki.TestA</SPAN>)} </div> <div class=vspace> </div> <div class=vspace>My Test page Content:</div> <DIV id=wikitext> <div>Test A Complete<BR>Test B Complete<BR>Test C Pending </div></DIV> <DIV class=clearer><!-- a clearer division --></DIV> <div class=vspace> </div> <div class=vspace>Wiki Version: <EM>pmwiki-2.1.27</EM></div> <div>Skin: FixFlow</div> <div> </div> <div> </div> <div>Thanks for all of your help on this,</div> <div>Ben</div> <div class=vspace><BR><BR><B><I>Hans <design5@softflow.co.uk></I></B> wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Friday, January 18, 2008, 8:24:52 PM, wiki question wrote:<BR><BR>> Maybe -- Can you explain how page text variable work.<BR>> A simplified example of what I am
trying to accomplish:<BR><BR>> Page basically contains:<BR><BR>> TEST_NAME TEST_STATUS<BR>> Test A Complete<BR>> Test B Not Started<BR>> Test C In Progress<BR>> Test D Complete<BR>> Test E In Progress<BR>> ... <BR>> ...<BR>> ..<BR><BR>> I want to display, on a seperate page, only those tests that are completed and<BR>> have it refresh when the main page is updated.<BR><BR>> So in the current state Test A and D will display<BR><BR>This is a tricky problem. I don't think page text variables are the<BR>best answer, but I will explain it a bit, before offering a different<BR>solution:<BR><BR>Page text variables (PTVs) can be defined in various ways, but the variable<BR>name cannot contain spaces and has to start with a letter.<BR>So your MainPage could contain this, which will automatically defines<BR>PTVs:<BR><BR>TEST_NAME: TEST_STATUS<BR>Test_A: Complete<BR>Test_B: Not Started<BR>Test_C: In Progress<BR>Test_D: Complete<BR>Test_E: In
Progress<BR><BR>Each PTV can be referred to as {$:Var}, i.e. {$:Test_A}, which<BR>displays its value, i.e. 'Complete'.<BR>From a different page it can be referred to with<BR>{PageName$:Var}, i.e {MainPage$:Test_A}<BR>And importantly PTVs can be used in conditional markup.<BR>So your page can contain this:<BR><BR>!!Completed Tests:<BR>(:if {MainPage$:Test_A} 'Complete':)Test A<BR>(:if {MainPage$:Test_B} 'Complete':)Test B<BR>etc.<BR>(:ifend:)<BR><BR>This may give you an idea how to work with PTVs.<BR>It may even be good enough for your problem.<BR><BR>A different approach, I thought, would be to extract text rows from<BR>a page which contain a certain string. Here is a definition of a markup<BR>expression which does this. It should be added to config.php:<BR><BR># {(textrows 'STRING' PAGENAME)} displays textrows from page PAGENAME which<BR># have STRING in them (as a substring). STRING is case sensitive.<BR># {(textrows 'STRING' PAGENAME#section)} displays textrows with
STRING from<BR># section #section of PAGENAME.<BR># The current page cannot be a source for textrow extraction.<BR>$MarkupExpr['textrows'] = 'ExtractTextRows($pagename, @$args[0], @$args[1])';<BR>function ExtractTextRows($pagename, $str, $source) {<BR>if ($str=='' || $source=='') return '';<BR>$pn = MakePageName($pagename, $source);<BR>if ($pn==$pagename) return '';<BR>$page = RetrieveAuthPage($pn, 'read', true);<BR>$text = $page['text'];<BR>$section = TextSection($text, $source);<BR>$textrows = explode("\n",$section);<BR>$newrows = array();<BR>foreach ($textrows as $row) {<BR>if (strstr($row, $str))<BR>$newrows[] = $row;<BR>}<BR>return implode("\n", $newrows);<BR>}<BR><BR><BR>So with this you could put into the page:<BR><BR>{(textrows Complete MainPage)}<BR><BR>and it will display:<BR><BR>Test A Complete<BR>Test D Complete<BR><BR>Note it displays whole text rows, not just Test A, Test B.<BR>It is a text extraction tool, and can be sourced from a whole page or<BR>a page
section.<BR><BR>I suppose it could be easily modified, for your case, to remove the<BR>STRING from the textrows, by changing in the function this:<BR><BR>foreach ($textrows as $row) {<BR>if (strstr($row, $str))<BR>$newrows[] = $row;<BR>}<BR><BR>with this:<BR><BR>foreach ($textrows as $row) {<BR>if (strstr($row, $str)) {<BR>$row = substr_replace($row, '', strpos($row, $str), strlen($str));<BR>$newrows[] = $row;<BR>}<BR>}<BR><BR><BR>~Hans<BR><BR></BLOCKQUOTE><BR><p> 
<hr size=1>Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a>