[Moin-user] Moin subpages

Keith Schwols kcs at fc.intel.com
Thu Nov 3 17:24:45 EST 2005

I have a slight problem with a special macro that invokes an action (to 
make it more obvious to users how to add an entry)

The macro is BlogEditButton

from MoinMoin import wikiutil
def execute(macro, args):
  if args=='':
     ButtonText="Add Blog Entry"

  html="""<form method="post" action="%s?action=BlogEdit">
          <input type="submit" value="Blog Edit">
          </form>""" % pageName

          <input type="button" value="%s" 
          </form>""" % (ButtonText, pageName)
  return macro.formatter.rawHTML(html)

which is pretty straightforward (and I apologize to original author; 
I've lost your email where I got this fragment from)

My problem is when this Button is on a wiki subpage (e.g. 

If I view the page as 
http://wiki.domain.com/moin/KeithSchwols_2fWorkBlog (i.e. the slash is 
URI encoded), the button works fine.  However, if I view 
http://wiki.domain.com/moin/KeithSchwols/WorkBlog and then hit the edit 
button I end up in a subpage below the current page 


If I can detect that the user is view the URL without encoding, striping 
the leading parent page(s) from pageName seems to work.  But, then URI 
encoded pages fail.

Keith  (BTW, this is a Moin 1.2 version I'm using)

Keith Schwols				kcs(at)fc.intel.com 
Inside Intel 			        FCDC Tools section
3400 Harmony Road HRM1-1                Ft. Collins, CO 80528

On the outskirts of every agony sits some observant fellow who points.
					  -Virgina Woolf

More information about the Moin-user mailing list