Microformats Semantics Questions - microformats

I'm trying to get into adding microformats to my site, but I'm still confused about a couple of things.
Do microformats always have to be within an hcard or vcard element?
Can I have multiple hcards on one page?
Can I have non-microformat content inside an hcard tag?
I'm working on a site and they have their address in two places on their homepage, as well as a callout for a hotline. So I'm just trying to figure out how to place the microformats.
Assuming everything has to be wrapped in an hcard element, would this be the correct way to mark up my code for the hotline callout?
<p class="hcard">Call us 24 hours a day, 7 days a week at <span class="tel hotline">415.441.KIDS (5437)</span></p>
Is using the class "hotline" ok? Can I put both "tel" and "hotline" in the same class attribute? Is it ok that that extra 24/7 text is inside the hcard element? What about the letters/numbers part at the end?

No.
Yes.
Yes.
Your example should look like this:
<p class="vcard">Call us 24 hours a day, 7 days a week at <span class="tel hotline"><abbr title="415.441.5437" class="value">415.441.KIDS (5437)</abbr></span></p>
Changes:
The root class is vcard, not hcard.
The "tel" needs a value. (It can also have a "type", which defaults to "voice".)
Use <abbr> to indicate the machine-readable value. ("415.441.KIDS (5437)" isn't quite a phone number; it's a description of a phone number.)
Is using the class "hotline" ok?
Yes.
Can I put both "tel" and "hotline" in the same class attribute?
Yes.
Is it ok that that extra 24/7 text is inside the hcard element?
Yes.
What about the letters/numbers part at the end?
No (see above).

I think you are confused. hcard is one specific microformat (among others):
hCard is a simple, open, distributed format for representing people, companies, organizations, and places, using a 1:1 representation of vCard (RFC2426) properties and values in semantic HTML or XHTML. hCard is one of several open microformat standards suitable for embedding in HTML, XHTML, Atom, RSS, and arbitrary XML.
Therefore you can have many hcards in a page, each representing one people, company, etc. E.g. in your company's site, one for each office or for people in the organisation

Related

Semantic Directory Names (Singular or Plural)

Does the name of a directory title 'the container' or the 'contents'? This question nags at me because if the name of a directory semantically titles 'the container' then the name should be singular. (By analogy: When referring to an actual physical bag that contains your groceries - one would probably refer to it as a 'grocery' bag and not the 'groceries' bag.) Conversely if one were to assert that the name of the directory titles the contents of the directory then it would make more sense to use a plural form.
I understand that there are common-sense and even usability concerns associated with this question; however, although I would like to hear the practical results of these two options I am more concerned with semantics.
So in summary: does the name of a directory serve as a title for the container or the contents?
Thanks.
A directory on its own needs no name as a directory without any content is useless. Directories exist to group a set of files together. Even if a directory is currently empty, it represents such a group, just that there are currently no files in this group and that's why it is empty. So the name of a directory should always describe what you can find within that directory.
Assume you have a drawer with boxes and you use these boxes to group physical objects together. To know what is inside each box without having to first open it and look inside, you label the boxes. How would you label these boxes?
If a box contains pencils, you'd label it Pencils and not Pencil, correct? If a box contains paper clips, you'd label it Paper Clips and not Paper Clip, wouldn't you? That's because in these cases the label only describes the kind of item to be found within the box. Same goes for directories. A directories containing pictures should most likely be named Pictures, so you know that the files you can find inside it are of type picture.
But sometimes you group items together, not because they are of the same kind but because they belong to the same "entity". E.g. if you have a large box that contains all items related to your trip to Japan in 2012, you would label it "Trip to Japan, 2012" or maybe just "Japan, 2012". Actually you could label it "Trip to Japan in 2012 Items" but "Items" is redundant, as it is obvious you will find items inside. The same way it is redundant to add "Files" to a directory name. So if you are not grouping files because the files itself have something in common but because they belong to a common "entity", you usually name the directory after that entity and since is only one such entity, it would be singular.
A directory with the pictures of Peter's Birthday would most likely be named Pictures/Peter's Birthday. On the other hand, if you keep pictures of every birthday of Peter, year after year, you would rather use a structure like Pictures/Peter's Birthdays/2016. Note how it suddenly became "Birthdays" as now the directory name again describes the kind of items found inside and not an individual event/purpose.
As a general rule of the thumb: Always name directories in such a way that the reader of the directory name has a very good idea of what kind of files and other directories they can expect to find inside that directory, so they can decide whether it's interesting to "go there" or not by just having read the directory name.
If you name a directory Recipe, what will the reader expect to find inside? I would expect to find one or more files, all belonging to a single recipe, e.g. a short ingredient list, a longer instruction text and maybe some supporting photos. Contrary, if you name the directory Recipes, what will the reader expect to find there? I would expect several recipes, either multiple files and every file contains one recipe or multiple sub-directories and each one contains the files that belong to one recipe. As you can clearly see by this simple example, whether you choose plural or not has an effect on the expectation of the reader.
My first impulse is to say that you name a generic container based on its contents. But I'll dig a little deeper just for the fun of it. (Scroll to the end if you just want the summarised conclusion.)
Firstly, I don't think Tum's car and cake examples help us very much. Sure, they are made from simpler components, but only for the purpose of creating new and self-contained objects. The grocery bag is a collection of molecules—so what. The more meaningful thing to ask is: is the object's fundamental purpose to hold other objects? In other words, is it a generic container, like the folder in a file system? You would definitely answer no to the cake. You would probably answer no to the car (even though it does, admittedly, hold people). You would certainly answer yes to the grocery bag.
In your grocery bag example, you said we would refer to it as a grocery bag and not the groceries bag. Sure. The following sentences are all grammatically correct and natural sounding:
Would you help me bring the bags in?
Would you help me bring the grocery bags in?
Would you help me bring the groceries in?
Would you help me bring the shopping in?’
The first sentence is only meaningful if the listener knows we just went shopping and can infer the contents of said bags without us telling them. Without that information, the bags might, for all we know, contain venomous snakes. The second sentence is the most descriptive, but includes redundant information. Anyone familiar with groceries and the process of buying them can reasonably infer that they will be contained in bags. The third sentence tells us all we need to know in the most succinct manner.
The forth sentence takes a different approach entirely, labelling the singular activity that produced the groceries. But it doesn't tell us what kind of product we shopped for, so it’s not as descriptive. (Sometimes this approach is the best option as will be seen in other examples.)
If you look at the user's home folder on any new Windows PC or Mac, you'll find it pre-populated with folders like Documents, Downloads, and Pictures. A folder labelled 'Pictures' tells us all we need to know. You could choose to suffix all your directory names with 'dir', 'folder' or something similarly redundant, but it adds nothing meaningful. (I'm old enough to remember seeing Mac users of yesteryear add the 'ƒ' character—generated by pressing Option-F—to the end of folder names. Crazy times.)
Ah, but there are exceptions! On my Mac, Apple (in its infinite wisdom, of course) chose singular names for three subfolders: Desktop, Library and Public. The rationale, one suspects, is that no one knows what the Desktop contains—not even the user oftentimes! Similarly, the Public folder might contain anything. To get all scholarly, we would call it a heterogeneous collection. It’s like that big box of stuff you pull out at Christmas time, which contains a hotchpotch of stuff like tinsel, baubles, stockings, wrapping paper and fake snow—easier to just label it ‘Christmas’, according to its purpose and theme.
The Library folder is an interesting one—not so much because Apple didn't name it according to its contents, but because it gives us an interesting real-world example. Is the purpose of a library to hold other objects, or is it a functional object in its own right? I'd say it's somewhere in the middle. Let’s say we decide to label a real-world library based on contents. We could call it ‘Books’. (Most libraries contain more than books, but to keep it simple we'll imagine that our library only contains books.) A library could hang a big sign out front that just said 'Books'—but then you might assume the books were for sale, rather than free to borrow. You'd probably assume this because you live in a capitalist society where most big signs are trying to peddle something. So the question of semantics is also one of context.
There's one more question of context that you didn't supply in your question. Where are these directories stored? Are they on your personal computer, or are they on a web server? Why does it matter? Well, on your PC, you're probably viewing each folder in a GUI, where the label is attached to an individual icon. But if the directories are part of a website structure, it's more likely that users will only ever see the names as part of a file path (if they notice them at all). The question here is, do you care, and if so, do you want the file path to read like a sentence? This is best illustrated by an example:
http://acme.com/order/explosive/detonator/dx3000
While each category could be plural, the path reads more like an English sentence by using singular directory names. While this seems a bit forced perhaps, you do see this approach on some websites.
TL;DR: When the function or theme of a container is more descriptive than its contents, a singular label (e.g. Library, Desktop, Christmas) can work best. The more heterogeneous a collection, the more likely this approach will make sense. But in most cases, labelling the plural contents (e.g. Documents, Downloads, Pictures) of the collection is easier and more descriptive.
Interesting question.
If you look at a class as a substitute for a tag name (something you would do when using a <div> or a <span>, which have no semantic meaning), your class would have to describe the contents of the element.
But at the same time, the element it self is the content. If you look at a car you say 'this is a car', you don't say 'these are car parts'. Or, if you eat a cake you call it 'cake' and not 'ingredients'.
So I guess a semantic class name would be singular and not plural, because it is always only one element. This might result in using a lot of 'wrapper' in your class names, because finding a fitting name for your element is not always that easy.
I hope this answers your question, if not you might want to read this: http://css-tricks.com/semantic-class-names/
The convention proposed by user Mecki is coherent, but I wonder whether it is really useful in the context of file organization.
In my experience, a very useful convention is to see file path components as a collection of searchable tags. This aids in classifying and finding files, which, for me is the main purpose of establishing a convention for directory and file names.
For example, one file could be named camera-MODEL-manual.pdf (where MODEL is the concrete model). There could be also a directory that contains various manuals. Or perhaps there are multiple manuals for a particular device. In that case, they could be kept in manual/DEVICE/.... Naming directories that contain manuals with the tag "manual" in singular helps searches for manuals.
Within this convention, one can search for file paths containing "birthday" and "peter" without having to remember whether the directory is "2022-birthday-peter" or "birthday/peter/2022". Or one can search for all PDF files whose path contains "car" to find some car-related document.
While in English most plural forms are simply created by adding an "s" suffix, so that a search for "birthday" may bring up "birthdays", this is not true in many other languages. And even in English, it may be preferable to search for whole words, such that a search for "birth" does not bring up "brithday".

Address form fields for a japanese address

I am building a small application for an english speaking client in Japan. As part of the app, users need to be able to enter their address. Unfortunately, I can't find any reference for how addresses are usually handled in an online form.
I know that there are different combinations of wards/prefectures/cities; do these all usually have their own field in a database? Is it standard for all of that to go into a general "city" type of field? What's the standard UI for this sort of thing?
The Universal Postal Union has compiled info on address formats in different countries. See also an unofficial guide to postal addresses.
But as a rule, internationalization of software typically means that for postal addresses, you avoid imposing any specific format. Instead, you would use a free-form text input area, of sufficient size. There are often many forms of addresses used in a country (and Japan is no exception), and normally you need not enforce any specific format – instead, you expect people to know their own address and how to enter it so that postal services can understand it.
it depends on what you have to do with the address:
if you have to:
check for obligatory fields
validate fields, or
query for city, prefecture, postal code, etc.
then you should use separate fields. UI: a form with text-inputs (and maybe even menus).
do not use more fields than necessary, so if you don't have any of the mentioned needs, just use a text-field (UI: textarea).
The first part of a Japanese address is easy: Todofuken will either be 2 or 3 characters, followed by either "都","道","府" or "県". Where it gets tricky is the rest of the address since smaller areas don't always divide their cities neatly.
What I've seen to make this easier is using the postal code to render the address. The bad news is that I haven't seen any of this in Ruby but I have seen it in other languages so hopefully this will help.
This site is only in Japanese, but maybe you can download the code and check it out:
http://www.kawa.net/works/ajax/ajaxzip2/ajaxzip2.html
There's also this add-in for Excel that converts addresses. The code may be helpful to you:
http://office.microsoft.com/ja-jp/excel-help/HP010077514.aspx
Hope this helps.

Google has all the wrong keywords

I hope stackoverflow is the right part of the trinity to ask this kind of question ...
Google webmaster tools shows the keywords it considers important for my blog (blog.schauderhaft.de). But among the top 20% are all the month names (you know january and so on).
I actually have a two part question about this:
why does google think theses are important keywords?
how do I fix that?
It might have something to do with the whole list of archives in the head of your page: <link rel='archives' title='January 2008' and so on.
Do you think this will actually be a problem? These people don't seem to think so..
We used to have a big problem on one of our client websites with a similar problem country names appearing most important. On some pages we were running multiple forms where one could choose a country. Google was finding this all over the place and thus considered it important.
So if you have month names in archives/in dates of articles it might very well be a possibility. You have to ensure you tag each one properly if its a date you can maybe use the HTML5 code to identify that its a date; otherwise in case of archives what you can do is load this using AJAX; or calculate it using javascript.
In order to drop the counry names we had to use a jQuery trick to insert these dynamically into the page following page load. (so google no longer sees the list as important to our website)

How can I present multiple pages with similar content (mostly images) without Google penalizing me?

I have a website that presents Q&As to mathematical problems, mostly for pupils aged approx. 16-18 years old. Due to the difficulties of presenting formulas on webpages, the Q&As (formulas) are presented as images. At the moment, each webpage contains one Q&A, and there are many questions and answers. Thus, with little in the way of text, every page looks almost identical. Therefore, Google might very easily see this as duplicate content. What is my best solution to this problem? Should I try put the Q&As in a database and present each different one on the same page (dynamically). Or should I keep things the way they are and prevent Google from seeing most of the Q&As? It is also difficult to make different titles, descriptions etc. as, for each topic, only the question number changes.
Many thanks for your time.
You're basically a ghost to google anyways if there is no text on each page. If you are worried about SEO you need to worry about text.
You should at the very least look into tagging the formulas or creating a title for the question which is relevant and putting that into a header tag above the question image.
Otherwise no one will find you by that content and that's what it's all about.
You said it: you can hide the QandA file/directory in the robots.txt file of your web server.
Disallow: /QAfolder
or
Disallow: /Q1.htm
Disallow: /Q2.htm
Disallow: /Q3.htm
or whatnot.
Normally, this would be a bad thing (preventing users from searching for question content) but as you said, they're images anyway.
Create descriptive useful page titles and meta descriptions.
Create textual representations of what is in the image using alt tags.
Use Different headers.
This could be a little hard to think about as in your context. but, you may be able probably use the question type description or name of the chapter its taken from. basically a text description relevant to the question.
One more thing you can do is. If you have empty space on your page, you can put in some text that describes your website and at the same time uses the right keywords(that you are targeting) in the right percentages Higher up in the page - You may writeup 2-3 different descriptions and alternate them between pages, i.e. if your design permits you.

dynamic text in <h1> tag

what would be the impact on SEO of changing the text of the <h1> dynamically on the server side each time the web page loads?
I'm not talking about changing the whole text, just part of it, for example if the header contains some fixed text (with keywords of course), and also contains the current date or time/the current number of logged on users/the count of items current in stock/whatever.
how would that affect my ranking? is it bad? doesn't make a difference?
thanks.
i don't think that element you need should be H1, since semantically, H1 is most important heading on a page which can but shouldn't contain anything that isn't of crucial importance like that number of logged in users o time.
Personally, i would use H1 just for important heading which contains important keywords.
Otherwise, you can put wanted H1 and perhaps a Paragraph and put them in a DIV altogether for such purpose where paragraph contains content irrelevant to page and still harness the value of a H1 and content you want in virtually the same spot.
You can use dynamic text in H1, but you need to make sure that no duplicates is allowed. Its not recommended to have duplicate H1 across the site.
You can use dynamic text in H1, but make it a template based.
For Example: If you have categories in your shopping cart and want to display the name of the category in H1...follow a templated structure like
"category-name | Keyword or Company Name"
By doing so, you do not have duplicate tiles, and can achieve uniform structure across the site
Similarly for product pages
"category-name | product-name | Website Name or Company Name"
If you have a long titles with dates and numbers and query string, format in a way which can be read by users and searchbots, and remember the semantics
The fact that h1 tags affect SEO is far from being a myth, but with SEO evolving the way it is, it's becoming fairly useless. It's the same thing with meta information and such practices: after the Panda and Penguin, and other reforms Google is making right now, all SEO methods that are easy to abuse of are becoming less and less important for being ranked in Google. Back in the day people could rank at the top by repeating a keyword hundreds of times on a page, in the same way that properly written h1s ranked sites very well. We're far from those times now, Google is aware of the fact that people can abuse of these simple practices, so anything from h1 text, to meta, and even to backlinks, is taking less importance in search engines by the day.
Rather than focusing on h1s, which you shouldn't be putting much effort in, focus on writing good content, and on updating that content as frequenly as possible. Good luck :)