You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Jaak <va...@hot.ee> on 2002/07/15 07:14:32 UTC

page title

Hi!

I try to display a page title using three embperl files.

---main.epl---
[! sub title {'Website'} !][- $req = shift -]<HTML> <HEAD> <TITLE>[+
$req->title +]</TITLE> </HEAD><body>[- Execute('*') -]</body> </HTML>
---

---first.epl---
[- $req = shift -] <HTML> First... [- Execute('second.html ') -]</HTML>
---

---second.epl---
[! sub title {'Second page'} !] [- $req = shift -] <HTML> Final page</HTML>
---

When I access second.epl directly via main.epl then it works fine.
But accessing second.epl via main.epl -> first.epl then title is not
imported
anymore.
What am I doing wrong?

I'm using Embperl 2.0b8.

Thanks in advance.

---
Sorry but I had to resent this message because it seems that the previous
message did not
come trough :-(




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: page title

Posted by Aaron Johnson <so...@gina.net>.
On Mon, 2002-07-15 at 01:40, Angus Lees wrote:
> At Mon, 15 Jul 2002 08:14:32 +0300, variable wrote:
> > I try to display a page title using three embperl files.
> > 
> > ---main.epl---
> > [! sub title {'Website'} !][- $req = shift -]<HTML> <HEAD> <TITLE>[+
> > $req->title +]</TITLE> </HEAD><body>[- Execute('*') -]</body> </HTML>
> > ---
> > 
> > ---first.epl---
> > [- $req = shift -] <HTML> First... [- Execute('second.html ') -]</HTML>
> > ---
> > 
> > ---second.epl---
> > [! sub title {'Second page'} !] [- $req = shift -] <HTML> Final page</HTML>
> > ---
> > 
> > When I access second.epl directly via main.epl then it works fine.
> > But accessing second.epl via main.epl -> first.epl then title is not
> > imported anymore.
> > What am I doing wrong?
> > I'm using Embperl 2.0b8.
>

There is a possible typo in the above first.epl example. You have
Execute('second.html') should that be Execute('second.epl') ?

Aaron

 
> (assuming its all similar to HTML::EmbperlObject 1.3..)
> 
> EmbperlObject sets up the following inheritance:
> 
>       page you requested (aka '*')
>  isa  the _base.epl found (or whatever EMBPERL_OBJECT_BASE is)
>  isa  EMBPERL_OBJECT_HANDLER_CLASS (if set)
>  isa  HTML::Embperl::Req (presumably Embperl::Req in 2.0)
> 
> 
> note that "second.epl" won't feature in that list anywhere, unless it
> was the actual page requested.  going "via first.epl" will never work.
> thus $req->title will get the one in main.epl (assuming thats your
> EMBPERL_OBJECT_BASE).
> 
> if you want to change this inheritance list, you'll need to do so by
> calling Execute({isa => 'second.epl'}) in first.epl somewhere.  see
> Embperl docs (again, i presume this is the same (and working) in
> Embperl 2)
> 
> -- 
>  - Gus
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: page title

Posted by Angus Lees <gu...@switchonline.com.au>.
At Mon, 15 Jul 2002 08:14:32 +0300, variable wrote:
> I try to display a page title using three embperl files.
> 
> ---main.epl---
> [! sub title {'Website'} !][- $req = shift -]<HTML> <HEAD> <TITLE>[+
> $req->title +]</TITLE> </HEAD><body>[- Execute('*') -]</body> </HTML>
> ---
> 
> ---first.epl---
> [- $req = shift -] <HTML> First... [- Execute('second.html ') -]</HTML>
> ---
> 
> ---second.epl---
> [! sub title {'Second page'} !] [- $req = shift -] <HTML> Final page</HTML>
> ---
> 
> When I access second.epl directly via main.epl then it works fine.
> But accessing second.epl via main.epl -> first.epl then title is not
> imported anymore.
> What am I doing wrong?
> I'm using Embperl 2.0b8.

(assuming its all similar to HTML::EmbperlObject 1.3..)

EmbperlObject sets up the following inheritance:

      page you requested (aka '*')
 isa  the _base.epl found (or whatever EMBPERL_OBJECT_BASE is)
 isa  EMBPERL_OBJECT_HANDLER_CLASS (if set)
 isa  HTML::Embperl::Req (presumably Embperl::Req in 2.0)


note that "second.epl" won't feature in that list anywhere, unless it
was the actual page requested.  going "via first.epl" will never work.
thus $req->title will get the one in main.epl (assuming thats your
EMBPERL_OBJECT_BASE).

if you want to change this inheritance list, you'll need to do so by
calling Execute({isa => 'second.epl'}) in first.epl somewhere.  see
Embperl docs (again, i presume this is the same (and working) in
Embperl 2)

-- 
 - Gus

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org