List Info

Thread: Re: An Inconvenient hCard




Re: An Inconvenient hCard
country flaguser name
New Zealand
2007-03-20 18:55:34
From: "Ara Pehlivanian" <ara.pehlivaniangmail.com>
To: "Microformats Discuss"
<microformats-discussmicroformats.org>
Sent: Monday, March 12, 2007 1:06 PM
Subject: [uf-discuss] An Inconvenient hCard


> I've got a bit of a problem with an hCard that I need
to mark up and I
> was wondering if anyone could lend me a hand.
>
> I realize the syntax requires that a type be specified
for telephone
> numbers ("voice", "fax", etc...)
and that's where my problem lies.
> It's inconvenient to have the word "voice"
appear in the markup
> because that's not how the convention (at least in this
neck of the
> woods) is when writing out contact information. The
final display
> should be:
>
> Tel.: (514) 123-4567
> Fax: (514) 123-4568
>
> Yet with the required "voice"/"fax"
types it ends up like this:
>
> Voice Tel.: (514) 123-4567
> Fax Fax: (514) 123-4568
>
> or in the French version of the page:
>
> Voice Tél.: (514) 123-4567
> Fax Téléc.: (514) 123-4568
>
> I realize that it's simple enough to just hide the
types via CSS, but
> being the strict standards advocate that I am, I don't
like entangling
> the structural layer with the presentational one by
making it
> dependent on it. The idea of superfluous words
littering my markup
> without proper grammatical consideration doesn't sit
well with me.
>
> I thought of doing something like this:
>
> Tel.: (514) 123-4567 (Voice)
> Fax: (514) 123-4567 (Fax)
>
> or in the French:
>
> Tél.: (514) 123-4567 (Voice)
> Téléc.: (514) 123-4568 (Fax)
>
> But it's redundant in English and nonsensical in
French.
>
> So, dear Microformats community, please lend me a hand
and help me
> unravel this conundrum of mine.

I have a creative solution here for you, inspired from
Fax Téléc.: (514) 123-4568

If the page is in a foriegn language, such as French, you
really should mark 
up non-French words with the appropriate language attribute
HTML - lang
XHTML 1.0 - lang and xml:lang
XHTML 1.1 - xml:lang
<span xml:lang="en">Fax</span>Téléc.:
(514) 123-4568

Then you can use a stylesheet to hide the english word.
span [lang=en] {display: none;}

Let's take this one further. Markup the new code as a
telephone microformat.

<p class="tel">
    <span class="type"
xml:lang="en">Fax</span>
    Téléc.:
    <span class="value">(514)
123-4568</span>
</p>

And hide the english text inside the microformat
.tel [lang=en] {display: none;}

-- 
Paul Wilkins 

_______________________________________________
microformats-discuss mailing list
microformats-discussmicroformats.org
http://microformats.org/mailman/listinfo/microforma
ts-discuss

Re: An Inconvenient hCard
user name
2007-03-20 20:00:45
On 3/20/07, Paul Wilkins <paul_wilkinsxtra.co.nz> wrote:
> From: "Ara Pehlivanian"
<ara.pehlivaniangmail.com>
> To: "Microformats Discuss"
<microformats-discussmicroformats.org>
> Sent: Monday, March 12, 2007 1:06 PM
> Subject: [uf-discuss] An Inconvenient hCard
>
>
> > I've got a bit of a problem with an hCard that I
need to mark up and I
> > was wondering if anyone could lend me a hand.
> >
> > I realize the syntax requires that a type be
specified for telephone
> > numbers ("voice", "fax",
etc...) and that's where my problem lies.
> > It's inconvenient to have the word
"voice" appear in the markup
> > because that's not how the convention (at least in
this neck of the
> > woods) is when writing out contact information.
The final display
> > should be:
> >
> > Tel.: (514) 123-4567
> > Fax: (514) 123-4568
> >
> > Yet with the required
"voice"/"fax" types it ends up like
this:
> >
> > Voice Tel.: (514) 123-4567
> > Fax Fax: (514) 123-4568
> >
> > or in the French version of the page:
> >
> > Voice Tél.: (514) 123-4567
> > Fax Téléc.: (514) 123-4568
> >
> > I realize that it's simple enough to just hide the
types via CSS, but
> > being the strict standards advocate that I am, I
don't like entangling
> > the structural layer with the presentational one
by making it
> > dependent on it. The idea of superfluous words
littering my markup
> > without proper grammatical consideration doesn't
sit well with me.
> >
> > I thought of doing something like this:
> >
> > Tel.: (514) 123-4567 (Voice)
> > Fax: (514) 123-4567 (Fax)
> >
> > or in the French:
> >
> > Tél.: (514) 123-4567 (Voice)
> > Téléc.: (514) 123-4568 (Fax)
> >
> > But it's redundant in English and nonsensical in
French.
> >
> > So, dear Microformats community, please lend me a
hand and help me
> > unravel this conundrum of mine.
>
> I have a creative solution here for you, inspired from
> Fax Téléc.: (514) 123-4568
>
> If the page is in a foriegn language, such as French,
you really should mark
> up non-French words with the appropriate language
attribute
> HTML - lang
> XHTML 1.0 - lang and xml:lang
> XHTML 1.1 - xml:lang
> <span
xml:lang="en">Fax</span>Téléc.: (514)
123-4568
>
> Then you can use a stylesheet to hide the english
word.
> span [lang=en] {display: none;}
>
> Let's take this one further. Markup the new code as a
telephone microformat.
>
> <p class="tel">
>     <span class="type"
xml:lang="en">Fax</span>
>     Téléc.:
>     <span class="value">(514)
123-4568</span>
> </p>
>
> And hide the english text inside the microformat
> .tel [lang=en] {display: none;}
>

Thanks for the work you put into this solution but I've got
two
problems with it. The first being what I mentioned in my
initial
posting (though I may not have been overly clear about it),
but hiding
content in CSS still means that the content is there for
unstyled
viewing. Secondly, the attribute selector isn't widely
supported
enough to make the solution viable on most browsers (in
particular
IE).

Thanks though. :-/

A.
-- 
Ara Pehlivanian

Site: http://arapehlivanian.com/

Email & GTalk: ara.pehlivaniangmail.com
MSN: ara_photmail.com
Twitter: http://twitter.com/ara_p/

_______________________________________________
microformats-discuss mailing list
microformats-discussmicroformats.org
http://microformats.org/mailman/listinfo/microforma
ts-discuss

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )