Fb:tag

From Facebook Developer Wiki

Revision as of 04:03, 30 September 2009 by Pete Bratach (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Contents

Description

Renders an HTML tag. This is most commonly used in conjunction with fb:intl to put translatable text in an attribute of an HTML tag.

You specify the attributes for the HTML tag in fb:tag-attribute tags directly under this tag. The fb:tag-body tag, if present, holds the contents of the tag.

Note this tag applies only to HTML. FBML-specific elements should use fb:fbml-attribute instead.

Attributes

RequiredNameTypeDescription
required name string The name of the HTML tag to render.

Examples

<fb:tag name="img"> <fb:tag-attribute name="src">http://myhost/image.png</fb:tag-attribute> <fb:tag-attribute name="alt"> <fb:intl>FooCorp company logo</fb:intl> </fb:tag-attribute> </fb:tag>

This renders as <img src="http://myhost/image.png" alt="FooCorp company logo" /> in English. In other languages the value of the alt attribute will be replaced with an appropriate translation, provided someone has translated the original string.


<fb:tag name="div"> <fb:tag-attribute name="class">user_info</fb:tag-attribute> <fb:tag-attribute name="title"> <fb:intl> <fb:name uid="12345"/> has {number} friends. <fb:intl-token name="number">15</fb:intl-token> </fb:intl> </fb:tag-attribute> <fb:tag-body> <fb:intl> <fb:name uid="12345"/> is in first place. </fb:intl> </fb:tag-body> </fb:tag>

A more complex example, a div with a tooltip whose text has dynamic content. This renders as <div class="user_info" title="John Smith has 15 friends.">John Smith is in first place.</div> in English.

See Also

reference