<title> in the body (I know it"s wrong)
<title> in the body (I know it"s wrong)
am 28.07.2007 20:57:34 von Paul Furman
I know it's wrong but it works: putting the
in the body of the
document inside another because I'm generating this with php &
kind of boxed myself into not having access to the text I want till I
get well into the body, for example:
http://edgehill.net/gallery/photo-update/6-24-07/pg1pc1
I noticed that duplicate titles have no effect.
--------------
Also, regarding length, the W3C folks say
http://www.w3.org/Provider/Style/TITLE.html
"Whilst there is no limit on the length of a title (as it may be
automatically generated from other data), information providers are
warned that it may be truncated if long."
I have no problem with truncating, the alternative would be for me to
truncate it myself. I'm gathering the titles from photo annotations
which are sometimes a long paragraph of text like:
http://edgehill.net/gallery/cameras/pg1pc3
Mozilla strips this to a about 300 characters:
1) Gitzo G1298 tripod with Linhoff LN9051 ball head 2) TC-14E AF-S
teleconverter 3) TC-20EII AF-S teleconverter 4) Tokina 300mm f/2.8 MF
(most of that is lens shade & teleconverters 5) MC-20 release 6) 105mm
f/2.8 AF-S VR Micro 7) Nikon D200 8) 135mm f/2
IE7 strips it to about 100 characters:
1) Gitzo G1298 tripod with Linhoff LN9051 ball head 2) TC-14E AF-S
teleconverter 3) TC-20EII AF
--
Paul Furman Photography
http://edgehill.net
Bay Natives Nursery
http://www.baynatives.com
Re: <title> in the body (I know it"s wrong)
am 28.07.2007 23:42:39 von Shion
Paul Furman wrote:
> I know it's wrong but it works: putting the
in the body of the
> document inside another because I'm generating this with php &
> kind of boxed myself into not having access to the text I want till I
> get well into the body, for example:
> http://edgehill.net/gallery/photo-update/6-24-07/pg1pc1
> I noticed that duplicate titles have no effect.
The effect depends on the browser, most browsers are made to correct the ill
written code that many WYSIWYG generates and badly written scripts as in your
case.
You should not echo out everything as soon as you have generated or fetched
the data, you can store things in variables and have the html generation last
//do here what you need to fetch your data
//and store it into variables like
$mysqli = new mysqli_connect('localhost','root','','database');
$result=$mysqli->query('select title from table where page='{$_GET['page']}');
list($title)=$result->fetch_array();
?>
$title ?>
Something
> --------------
> Also, regarding length, the W3C folks say
> http://www.w3.org/Provider/Style/TITLE.html
> "Whilst there is no limit on the length of a title (as it may be
> automatically generated from other data), information providers are
> warned that it may be truncated if long."
>
> I have no problem with truncating, the alternative would be for me to
> truncate it myself.
It's the browser that may truncate the title if the text is long, how long the
title may be depends on the browser and the size of the window (many browsers
alters the window title to the title).
--
//Aho
Re: <title> in the body (I know it"s wrong)
am 29.07.2007 00:13:04 von cwdjrxyz
On Jul 28, 1:57 pm, Paul Furman wrote:
> I know it's wrong but it works: putting the in the body of the
> document inside another because I'm generating this with php &
> kind of boxed myself into not having access to the text I want till I
> get well into the body, for example:http://edgehill.net/gallery/photo-update/6-24-07/pg1 pc1
> I noticed that duplicate titles have no effect.
>
> --------------
> Also, regarding length, the W3C folks sayhttp://www.w3.org/Provider/Style/TITLE.html
> "Whilst there is no limit on the length of a title (as it may be
> automatically generated from other data), information providers are
> warned that it may be truncated if long."
>
> I have no problem with truncating, the alternative would be for me to
> truncate it myself. I'm gathering the titles from photo annotations
> which are sometimes a long paragraph of text like:http://edgehill.net/gallery/cameras/pg1pc3
>
> Mozilla strips this to a about 300 characters:
> 1) Gitzo G1298 tripod with Linhoff LN9051 ball head 2) TC-14E AF-S
> teleconverter 3) TC-20EII AF-S teleconverter 4) Tokina 300mm f/2.8 MF
> (most of that is lens shade & teleconverters 5) MC-20 release 6) 105mm
> f/2.8 AF-S VR Micro 7) Nikon D200 8) 135mm f/2
>
> IE7 strips it to about 100 characters:
> 1) Gitzo G1298 tripod with Linhoff LN9051 ball head 2) TC-14E AF-S
> teleconverter 3) TC-20EII AF
>
> --
> Paul Furman Photographyhttp://edgehill.net
> Bay Natives Nurseryhttp://www.baynatives.com
The W3C shows many validation errors, but your page works on 5 common
browsers I have to test. If you end your url with just pg1, pc1, or
just a slash, you get 3 different pages, one being a photo of a bay
area country view. Likewise, using the error
javascript 1.2> instead of the now required
javascript"> works, despite being an error. The same for several other
errors. The point is that all or some browsers may work for certain
errors. However, with the next version upgrade, the browser may not
work with some errors that it did before. Then the webmaster may have
to hack a way around the problem or correct errors to get a certain
browser to work again. Of course some new browsers have bugs,
especially IE ones, but these usually are detected fairly early and
posts in groups such as this point out the problem and how to get
around it.
Re: <title> in the body (I know it"s wrong)
am 29.07.2007 02:25:00 von Adrienne Boswell
Gazing into my crystal ball I observed Paul Furman
writing in news:ykMqi.29886$2v1.842@newssvr14.news.prodigy.net:
> I know it's wrong but it works: putting the in the body of the
> document inside another because I'm generating this with php &
> kind of boxed myself into not having access to the text I want till I
> get well into the body, for example:
> http://edgehill.net/gallery/photo-update/6-24-07/pg1pc1
>
Better to put all your logic at the beginning of your script. Close
connections as soon as possible. It's also easier for you, as a
developer, to put that stuff at the top, easier to find and debug. I
write mostly ASP, but the same is true for any language, eg:
<% option explicit%>
<% 'declare variables
'open recordsets, get info and put it into arrays
'close recordsets
%>
<% 'above file includes the Doctype, html and head elements, stylesheet,
favicon, title, and meta information
%>
....
<% 'above closes db connection, end body and html %>
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Re: <title> in the body (I know it"s wrong)
am 29.07.2007 03:20:55 von Paul Furman
cwdjrxyz wrote:
> On Jul 28, 1:57 pm, Paul Furman wrote:
>
>>I know it's wrong but it works: putting the in the body of the
>>document inside another because I'm generating this with php &
>>kind of boxed myself into not having access to the text I want till I
>>get well into the body, for example:
http://edgehill.net/gallery/photo-update/6-24-07/pg1pc1
>
> The W3C shows many validation errors,
Oh yeah, I'm sure. I haven't tried validating for quite a while, my bad,
though some of those are intentional errors like this one designed for a
specific effect.
> If you end your url with just pg1, pc1, or
> just a slash, you get 3 different pages, one being a photo of a bay
> area country view.
original:
http://edgehill.net/gallery/cameras/pg1pc3
These should all take you to the first pic on the page:
http://edgehill.net/gallery/cameras/pg1 (page#)
http://edgehill.net/gallery/cameras/
http://edgehill.net/gallery/cameras
This produces an error, it's not designed to work:
http://edgehill.net/gallery/cameras/pc3 (pic# with no page)
(I could fix it with some more php coding & save another 2 characters in
the url but oh well, if someone gets creative they can't be too
surprised to get an error)
This is a weird way to show the wrong page of thumbnails:
http://edgehill.net/gallery/cameras/pg2pc3
(the displayed pic is on the previous page) LOL
> The point is that all or some browsers may work for certain
> errors. However, with the next version upgrade, the browser may not
> work with some errors that it did before. Then the webmaster may have
> to hack a way around the problem or correct errors to get a certain
> browser to work again.
Thanks, good point, that's why I asked. In an ideal world I can fix this
as J.O. suggested by doing all my processing before writing the html in
php but it's a huge nighmare of include files & lotsa work to fix at
this point.
--
Paul Furman Photography
http://edgehill.net
Bay Natives Nursery
http://www.baynatives.com
Re: <title> in the body (I know it"s wrong)
am 29.07.2007 03:26:20 von Paul Furman
Adrienne Boswell wrote:
> Gazing into my crystal ball I observed Paul Furman
> writing in news:ykMqi.29886$2v1.842@newssvr14.news.prodigy.net:
>
>>I know it's wrong but it works: putting the in the body of the
>>document inside another because I'm generating this with php &
>>kind of boxed myself into not having access to the text I want till I
>>get well into the body, for example:
>>http://edgehill.net/gallery/photo-update/6-24-07/pg1pc1
>
> Better to put all your logic at the beginning of your script.
Yes, that's my problem. I'm not sure it's easier to debug though, that
approach puts the html miles away from the relevant code so it's far
from easy (to me anyways). But yeah I did it wrong. I did do it right in
some portions of the code.
> Close connections as soon as possible.
No databse in this site believe it or not, it's all just nested folders
with content & little .txt files for annotations & shortcuts! I believe
it is rather hard on the poor server.
> It's also easier for you, as a
> developer, to put that stuff at the top, easier to find and debug. I
> write mostly ASP, but the same is true for any language, eg:
>
> <% option explicit%>
>
> <% 'declare variables
> 'open recordsets, get info and put it into arrays
> 'close recordsets
> %>
>
> <% 'above file includes the Doctype, html and head elements, stylesheet,
> favicon, title, and meta information
> %>
>
>
> ...
>
> <% 'above closes db connection, end body and html %>
>
>
--
Paul Furman Photography
http://edgehill.net
Bay Natives Nursery
http://www.baynatives.com
Re: <title> in the body (I know it"s wrong)
am 29.07.2007 05:58:07 von Paul Furman
cwdjrxyz wrote:
> If you end your url with ...just a slash, you get different..
OK thanks, I did see that on another page though not these ones, more to
look into thanks again.
--
Paul Furman Photography
http://edgehill.net
Bay Natives Nursery
http://www.baynatives.com
Re: <title> in the body (I know it"s wrong)
am 30.07.2007 15:13:02 von Toby A Inkster
Paul Furman wrote:
> I know it's wrong but it works: putting the
in the body of the
> document inside another because I'm generating this with php &
> kind of boxed myself into not having access to the text I want till I
> get well into the body
// I don't know the title yet, so I'll turn on output buffering and
// then output an empty title.
ob_start();
print "\n";
print "\n";
print "\n";
print "\n";
// OK. Now I know what the title is, so switch off output buffering
// and replace the empty title with the known title.
$title = 'Lalala';
print str_replace('',
"$title",
ob_get_clean());
?>
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 39 days, 16:46.]
demiblog 0.2.2 Released
http://tobyinkster.co.uk/blog/2007/07/29/demiblog-0.2.2/