freddo411 has asked for the wisdom of the Perl Monks concerning the following question:

I'm attempting to override a Mason method on one of my pages. I'd like to inherit the behavior of the parent method, but add a few bits to the output.
My hierarchy looks like this:
auto -> auto2 -> my_page
The parent method "leftnav" is defined in auto.
I expected my code in my page to look something like this:
<%method leftnav> <%perl> $m->comp( PARENT:leftnav, %ARGS ); # some code here to add some stuff at the bottom </%perl> </%method>
The above does not work.
Question:
* Is there a syntax for "PARENT"? What is it?
* If no, how to code something like this?

-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday

Replies are listed 'Best First'.
Re: Question on overriding a Mason method
by Anonymous Monk on Jan 12, 2012 at 02:19 UTC

    The above does not work.

    How?

    http://www.masonhq.com/docs/manual/Devel.html#accessing_methods_and_attributes

      I found my incorrect syntax on this. I needed to quote the string argument to comp();
      The correct syntax is:
      <%perl> $m->comp( 'PARENT:leftnav', %ARGS ); # some code here to add some stuff at the bottom </%perl>

      -------------------------------------
      Nothing is too wonderful to be true
      -- Michael Faraday