Tags:
create new tag
view all tags

Question

I'd like to add the option to set or change the parent of a topic directly from the edit template. It seems to me that this should do the job:

<!--
   * Set MYPARENT = %SEARCH{ "^%BASETOPIC%$" scope="topic" nosearch="on" type="regex" nototal="on" format="<nop>$parent" }%
-->
<label for="topicparent">%MAKETEXT{"Parent of this topic:"}%&nbsp;&nbsp;</label>
<select name="topicparent" id="topicparent">
<option id="tp_none" value="">(none)</option>
%TOPICLIST{"<option $marker id='tp_$name' value='$name'>$name</option>" selection="%MYPARENT%"}%
</select>

But MYPARENT is either not being set, or it is not being seen by the TOPICLIST exapansion. I've had to resort to Javascript to compute the right selection, but I feel like there must be a better way.

Environment

TWiki version: TWikiRelease04x00x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Fedora Core 3
Web server: Apache 2.2.0
Perl version: 5.8.5
Client OS: Fedora core 3
Web Browser: Firefox 1.5
Categories: Platform

-- TWikiGuest - 13 Mar 2006

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

Remove the <nop> from before the $parent in the SEARCH.

-- CrawfordCurrie - 11 Apr 2006

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2006-04-11 - CrawfordCurrie
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.