Mailing List Archive

EmbperlObject and title
EO is a _very_ nice idea. There is a problem with the title, though,
because why will you want to have the same (or no) title for all your
pages?

If I didn't miss it, there's no way to tell what title to use. I'll
suggest a placeholder in the base web page, something like

<TITLE>('*')</TITLE>

and then in the "real" web page have the title

<TITLE>This is the title</TITLE>

When Embperl sees this, it will replace the placeholder with the correct
value.

What do you think?
RE: EmbperlObject and title [ In reply to ]
>
> EO is a _very_ nice idea. There is a problem with the title, though,
> because why will you want to have the same (or no) title for all your
> pages?
>
> If I didn't miss it, there's no way to tell what title to use. I'll
> suggest a placeholder in the base web page, something like
>
> <TITLE>('*')</TITLE>
>
> and then in the "real" web page have the title
>
> <TITLE>This is the title</TITLE>
>
> When Embperl sees this, it will replace the placeholder with the correct
> value.
>

What is the correct value?

Gerald


-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
RE: EmbperlObject and title [ In reply to ]
> What is the correct value?

Not sure I understand your question, but I'll expand: This is taken from
the example from EO's doxpage:

/foo/base.htm:

<html>
<head>
<title>('*')</title>
</head>
<body>
[- Execute ('head.htm') -]
[- Execute ('*') -]
[- Execute ('foot.htm') -]
</body>
</html>

/foo/head.htm:

<h1>head from foo</h1>

/foo/sub/head.htm:

<h1>another head from sub</h1>

/foo/foot.htm:

<hr> Footer <hr>

/foo/page1.htm:

<TITLE>Title for Page 1</TITLE>
PAGE 1

/foo/sub/page2.htm:

<TITLE>Title for Page 2</TITLE>
PAGE 2

/foo/sub/index.htm:

Index of /foo/sub

If you now request http://host/foo/page1.htm you will get the
following page


<html>
<head>
<TITLE>Title for Page 1</TITLE>
</head>
<body>
<h1>head from foo</h1>
PAGE 1
<hr> Footer <hr>
</body>
</html>

If you now request http://host/foo/sub/page2.htm you will get
the following page


<html>
<head>
<TITLE>Title for Page 2</TITLE>
</head>
<body>
<h1>another head from sub</h1>
PAGE 2
<hr> Footer <hr>
</body>
</html>


The idea should of course be expanded to all <HEAD> tags, not only
<TITLE>.

Hope this is more clear.
RE: EmbperlObject and title [ In reply to ]
>
> > What is the correct value?
>
> Not sure I understand your question, but I'll expand: This is taken from
> the example from EO's doxpage:
>
Ok, now I understand what you mean.

I think normaly such a page would not contains a <title> tag (or a <head>
section), because it's already part of the main page.

What do you think of something like this:

<titel>[- title -]</titel>


and in the page you have

[$ sub title $] My Title [$endsub$]

would this solve your problem?

Gerald



-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
RE: EmbperlObject and title [ In reply to ]
> I think normaly such a page would not contains a <title> tag (or a
<head>
> section), because it's already part of the main page.

If you by "main page" mean the template (which I will assume) then it
will IMHO not be fine grained enough for most purposes. As I understand
EmbperlObjects, it can be used as a template to make a common look&feel
for your site. So you will place all the common stuff there, and have
the variable in the individual files. But the title (and maybe more
<HEAD> tags) will vary with the individual files.

> What do you think of something like this:
> <titel>[- title -]</titel>
> and in the page you have
> [$ sub title $] My Title [$endsub$]
> would this solve your problem?

This would be great! Maybe it is wise to consider something like this
for other <HEAD> tags as well (e.g. <META>), but <TITLE> is the most
important.
RE: EmbperlObject and title [ In reply to ]
>
> If you by "main page" mean the template

Yes

>(which I will assume) then it
> will IMHO not be fine grained enough for most purposes. As I understand
> EmbperlObjects, it can be used as a template to make a common look&feel
> for your site. So you will place all the common stuff there, and have
> the variable in the individual files. But the title (and maybe more
> <HEAD> tags) will vary with the individual files.
>

Yes, of course. EmbperlObject is new and I have much more ideas to enhance
it.

> > What do you think of something like this:
> > <titel>[- title -]</titel>
> > and in the page you have
> > [$ sub title $] My Title [$endsub$]
> > would this solve your problem?
>
> This would be great! Maybe it is wise to consider something like this
> for other <HEAD> tags as well (e.g. <META>), but <TITLE> is the most
> important.
>
>

You could try the following (I didn't have tried it, but I think it should
work. Further version of EmbperlObject will have such a mechanisem build in)

In the Template:

[- Execute ({inputfile => '*', import => 0}) -]
<titel>[- Execute ('*#title') -]</titel>


and inside your pages

[$ sub title $] My Title [$endsub$]


You can do this for more subroutines of course.

Let me know if it works

Gerald



-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
RE: EmbperlObject and title [ In reply to ]
> You could try the following (I didn't have tried it, but I think it should
> work. Further version of EmbperlObject will have such a mechanisem build in)

It actually works!

And it seems you can do almost anything with it!

--
Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582
Kaki Data tshirts, merchandize Fax: 3816 2582
Howitzvej 75 Åben 14.00-18.00 Email: kar@webline.dk
2000 Frederiksberg Lørdag 11.00-17.00 Web: www.suse.dk