[Moin-user] Parameterizable link to a different page in theactions toolbar

Brancovici, George-Sava Dr. George-Sava.Brancovici at eads.com
Wed Sep 30 05:04:36 EDT 2009


Hi!

I posted the two files involved on http://paste.pocoo.org/ :
http://paste.pocoo.org/show/139766/
http://paste.pocoo.org/show/139770/

The first file is the MoinMoin theme where I added an extra link to the
editbar labeled "ParentPage". This in turn generates an action Parent
(look for the comment "# GBS" before the sections in question), which
determines a script called "Parent.py" to be executed. Please bear in
mind that I'm not (yet :) an expert in either MoinMoin or Python, so
don't mind if I say something wrong or obvious..

I edited the main MoinMoin wiki-page to include the parameter:
#pragma redirect-to-link "http://www.apple.com"

The second file "Parent.py" simply tries to access this parameter,
redirect-to-link, and print its content.

When I click on the "Parent Page" with the main MoinMoin page opened, I
get the output:
"Redirect to parent page:
None "
which means that the the parameter redirect-to-link is empty.

(What I actually want to do is to use the value of the parameter to
initiate a redirect to the page it denotes, in this example
apple.com...)

Thanks,
George
 

> -----Original Message-----
> From: Brancovici, George-Sava Dr. 
> Sent: Wednesday, September 09, 2009 11:35 AM
> To: 'moin-user at lists.sourceforge.net'
> Subject: [Moin-user] Parameterizable link to a different page 
> in theactions toolbar
> 
> What I did was to put the pragma on the page, extend the 
> editbar with a new item "ParentPage" which is connected to a 
> new action called Parent, defined in Parent.py. It does get called.
> 
> The problem is that the "restaurant" parameter defined with 
> the pragma seems wo be empty within the execute function in Parent.py.
> 
> How do I properly access the "restaurant" parameter in the 
> Parent.py action?
>  
> Thanks!
> 
> PS: Sorry for the previous two messages sent to your personal address.
> 
> > 
> > > -----Original Message-----
> > > From: R.Bauer [mailto:rb.proj at gmail.com]
> > > Sent: Wednesday, September 09, 2009 10:08 AM
> > > To: moin-user at lists.sourceforge.net
> > > Subject: Re: [Moin-user] Parameterizable link to a
> > different page in
> > > theactions toolbar
> > > 
> > > Brancovici, George-Sava Dr. schrieb:
> > > > Hi,
> > > > 
> > > > I'm trying to use the space and extend the actions 
> toolbar to the 
> > > > right of the "More actions" combo box with something like a
> > > link (or
> > > > button,
> > > > etc) to a certain target page. The linked page should differ, 
> > > > depending on the page on which the user currently is. E.g.
> > > if the user
> > > > is on the "McDonalds" wiki page, the link will target the
> > > "FastFoodRestaurants"
> > > > wiki page.
> > > > 
> > > > There are two catches:
> > > > - the linked page is not necessarily the "parent" page, it
> > > should be
> > > > parameterizable e.g. through a variable defined by the
> > > editor on each
> > > > page.
> > > 
> > > can be done by a pragma defintition on the page
> > > 
> > > #pragma restaurant "McDonalds"
> > > 
> > > wikiutil.escape(self.request.getPragma('restaurant', defval=''))
> > > 
> > > > - the link should be on the actions toolbar or somwehere in
> > > the upper
> > > > part of each page, in order to optimize space usage.
> > > 
> > > look at theme.__init__.editbarItems search for Discussion for an 
> > > example.
> > > 
> > > 
> > > cheers
> > > Reimar
> > > 
> > > > 
> > > > Do you have any ideas about how to accomplish this?
> > > > 
> > > > Thanks!
> > > > George
> > > > 
> > > > 
> > > > 
> > > > 
> > > 
> > 
> ----------------------------------------------------------------------
> > > > --
> > > > 
> > > > 
> > > 
> > 
> ----------------------------------------------------------------------
> > > > -------- Let Crystal Reports handle the reporting - 
> Free Crystal 
> > > > Reports 2008 30-Day trial. Simplify your report design,
> > integration
> > > > and deployment - and focus on what you do best, core 
> application 
> > > > coding. Discover what's new with Crystal Reports now.
> > > > http://p.sf.net/sfu/bobj-july
> > > > 
> > > > 
> > > > 
> > > 
> > 
> ----------------------------------------------------------------------
> > > > --
> > > > 
> > > > _______________________________________________
> > > > Moin-user mailing list
> > > > Moin-user at lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/moin-user
> > > 
> > > 
> > > --------------------------------------------------------------
> > > ----------------
> > > Let Crystal Reports handle the reporting - Free Crystal
> > Reports 2008
> > > 30-Day trial. Simplify your report design, integration and
> > deployment
> > > - and focus on what you do best, core application coding. 
> Discover 
> > > what's new with Crystal Reports now.  
> http://p.sf.net/sfu/bobj-july 
> > > _______________________________________________
> > > Moin-user mailing list
> > > Moin-user at lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/moin-user
> > > 
> 




More information about the Moin-user mailing list