📜 ⬆️ ⬇️

An example of using microformats on a “live” project

Many resources today are trying to apply advanced technologies for their development, and sometimes even they themselves are the “engines” of these technologies. Now it happens with microformats. The term has not yet taken root, but already causing a large number of disputes, which in particular concern both the microformats themselves and the concept they implement.

Microformat. What is it? In principle, many answers have already been given to this question, and they sounded both completely opposite and complementary to each other. For example, how to correctly answer the question: for whom microformats are more intended, for people or for machines? And the answer to this question will be the key to understanding the essence of microformats.

It seems to me that the answer to the above question directly depends on the current situation in the field of web-technologies. I am sure that in the future reading and analysis of microformats will be completely the prerogative of the machines. The user will only benefit from the final result, the product of their activities. Unfortunately, now the majority of ordinary users do not even know about the existence of microformats, let alone benefit from them.
')

Today I want to show another way of introducing microformats on the example of the livents.ru resource. First and foremost, of course, you should decide which microformats are possible and necessary to be implemented on such resources. From the currently existing ones , we used hCard to describe the personal data of users, hCalendar to describe information about events and Rel-Tag microformat tags.

The greatest difficulty in implementing microformats in general is the initial unsuitability of the existing layout. Take, for example, the date format. It is difficult to find a resource where the date is displayed in the format YYYYMMDDTHHMMSSZ, so the most effective way is to use the <abbr /> tag, which we actually did.

A similar problem can be encountered when describing the location of the event (hCalendar microformat). Usually, the venue is described by at least three parameters: country, city, place. However, a significant disadvantage of the hCalendar microformat is the presence of only one field for this: location.

Naturally, the placement of blocks marked with microformats should be consistent with the logic of the page. Those. on the event description page, the event itself must be decorated with the hCalendar microformat, and the lists of its participants and observers with the hCard microformat. For Rel-Tag microformat, the tag cloud is an ideal place, but one should not forget the more “humanized" tags - interests.

Here's what we got in the end:
<abbr title = "20070712" class = "dtstart" />
<abbr title = "20070712" class = "dtstamp" />
<p> When: Thu, July 12, 2007 </ p>
<p> Where: <a title="SK Olimpiyskiy" href="http://livents/ru/places/64/"> SK Olimpiyskiy </a> </ p>
<abbr title = "Olympiysky Sports Complex, Moscow, Russia" class = "location" />
<p> Category: <a href="http://livents/ru/categories/24/" class="category"> Show </a> </ p>
<p class = "vcard">
Added by:
<a href="http://livents/ru/users/feoli/profile/">
<img width = "16" height = "16" class = "photo" src = "http://static.livents.ru/img/userpics/30_small_1172662928.jpg" />
</a>
<a href="http://livents/en/users/feoli/profile/" class="fn nickname url"> Feoli </a>

</ p>


What are we trying to achieve using microformats? For the person who visited the resource, nothing has changed in terms of the appearance of the page and the information content of its visible part. The answer is obvious - we tried to convert a monotonous set of HTML tags into ordered blocks of information, where the machine, analyzing the page, can distinguish the list of people from the list of tags, information about the event from a simple text block.

Already, there are all kinds of tools that allow extracting microformed data from pages and transferring them to other applications or resources. Let's hope that soon the situation will change, and the world wide web will turn into a semantic network, where everything will be laid out on the shelves :)

Source: https://habr.com/ru/post/11449/


All Articles