[[TracNav(APINav|nocollapse)]] = Fancy Layout = On Hyves we use several tags to control the markup of scraps, status updates, smileys and more. These tags work fine on Hyves, but we can imagine that if you use the API to display data from Hyves on your own website or application, you don't need or want these tags. To transform these tags to proper HTML-formatted strings you can use !FancyLayout. == Using Fancy Layout == You can use !FancyLayout for the following items: * Text markup; display bold, italic and strike-through text * Display of media (image or video) from Hyves. It's not possible to use media from external websites * Display of links to Hyvers, Hubs, internal and external webpages * Display Gadgets or embed video's from !YouTube * Display smileys In the Hyves API, you have two ways to work with Fancy Layout: * Adding the global parameter “''ha_fancylayout=true''” (without the quotes) to your API call; * Use the method ''fancylayout.parse''. === Using ha_fancylayout === If you add the global parameter “ha_fancylayout=true” (without the quotes) to your API call it will return all the fancy layout enabled return values in the correct formatting. A simple API call with fancy layout will look like the following: {{{ http://data.hyves-api.nl/?ha_fancylayout=true&ha_format=xml&ha_method=wwws.getByUser&ha_version=2.0&oauth_consumer_key=NjExMV8n1q7aieIEiflj0higiQGb&oauth_nonce=&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1274277612&oauth_token=YXRfMTU4OTk0MTIyX5nQ_zjW6b8oTEpPV6tTMPY%3D&oauth_version=1.0&userid=6c7ec0b62fca4e5f&oauth_signature=5xHAXh5j4Th5%2Bh9GAfrrOpk%2FXCQ%3D }}} This will return the following result: {{{ #!xml 00672dbd55bc2198017f17ec1faa5ed5be eating a banana :-d the forest http://gorillaapi.hyves.nl/wiewatwaar/238881236/j_IA/ 00cc68f39949140377bebf54013a15f63f superpublic 1274277880 10 1 1 12 1 112 false }}} As you can see the emotion field now contains proper formatted HTML instead of the tags used on Hyves. === Using fancylayout.parse === You can use the method fancylayout.parse to convert a string with specific Hyves tags to a proper HTML-formatted string. The method has 2 parameters: * '''string''' - The string you want to convert. This will be the string with tags. For this example we'll use this string: [b]This[ /b][i]is a[ /i][strike]string[ /strike] :) * This is a required parameter * '''fancylayouttype''' - You can use this parameter to skip specific elements from being fancy layout'ed * This is an optional parameter * You can use one or more of the following types: * search * body * oneliner * breadcrumb * link * title * gadgettitle * cleanhyvers * nickname * naturalname * edit * escape * hyver * amazon * flashname * url * blog * plaintext The API call for this will look the following: {{{ http://data.hyves-api.nl/?ha_fancylayout=false&ha_format=xml&ha_method=fancylayout.parse&ha_version=2.0&oauth_consumer_key=NjExMV8n1q7aieIEiflj0higiQGb&oauth_nonce=&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1274281918&oauth_token=YXRfMTU5MDA5Mzg1X5oQzTWK-7FfcBfqL8TIRDA%3D&oauth_version=1.0&string=%5Bb%5DThis%5B%2Fb%5D%5Bi%5Dis%20a%5B%2Fi%5D%5Bstrike%5Dstring%5B%2Fstrike%5D%20%3A%29&oauth_signature=NeIllvHxOYYk9eUtPIt%2Flovtl%2Fs%3D }}} '''Note:''' The string must be properly url encoded This will return the following result: {{{ #!xml Thisis astring :-) 11 105 false }}} For more information, see [wiki:APIMethods/1.2/fancylayout.parse fancylayout.parse]. === Supported tags === ||[b][ /b] || Used to display '''bold''' text || ||[i][ /i] || Used to display ''italic'' text || ||[strike][ /strike] || Used to display ~~strike-through~~ text || ||[media id=MEDIAID size=small] || Used to display a media item from Hyves (image or video) where MEDIAID is the ID of the actual media item and size is the displayed size which can be: small, medium, large or xlarge. || ||[hyver=USERNAME]DISPLAYNAME[ /hyver] || Used to display a link to a specific Hyver where USERNAME is the username of a specific Hyver and DISPLAYNAME is the name that will be displayed as a link (e.g. [hyver=gorillaapi]Gorilla[ /hyver]). || ||[url=URL]DISPLAY LINK[ /url] || Used to display a link on hyves where URL is the actual url and DISPLAY LINK is the variable which will be displayed. || ||[gadget][ /gadget] || Used to display a embed code such as !YouTube video’s and !OpenSocial Gadgets. || || :-) or :-( or ;-) || Used to display smileys. You can use [wiki:APIMethods/2.0/users.getSmileys users.getSmileys] to get an overview of all available smileys || === Return values === Fancylayout is supported by the following list of return values: * aboutme * body * cityname * countryname * description * displaybody * document * emotion * firstname * lastname * name * nickname * onmymind * subject * title * video * where * whitespacekey * whitespacevalue