Enyo DomNode to display FaceBook like button

edited February 2012 in Enyo 1.0
Hello,

I am trying to display FaceBook like button. Naturally, I planned to use enyo DomNode since FaceBook like button is HTML div.
However, the behaviour of DomNode was unexpected.

In below code, I could see a Horizontal line -- as result of "abc" -- but "def" which is DomNode is not displaying anything.

{name: "abc", content: "", kind: "DomNode", allowHtml: true},
{content: "#######"},
{name: "def", content: ""}
Do you have any idea, what was wrong? Thanks in advance.

Comments

  • sorry, i switched around for def and abc in above problem description.
  • In enyo v1, the default kind is Component which isn't renderable (meaning it's not intended to generate any UI elements). That's why def isn't showing anything. DomNode is the generic abstraction for a renderable kind and defaults to using a div for its control. That's configured by DomNode's nodeTag member.

    In general, I use the Control kind for generic containers since it provides some additional functionality over DomNode. However, with Control, the content is escaped by default so you'll have to set allowHtml=true if you want to include markup.

    I made a quick example of a Like button kind. I haven't done any facebook integration so I can't guarantee it works but it should illustrate the "enyo way" of doing it.
  • Thanks ryanjduffiy. Now I am able to display FaceBook like button using kind: "Control" (for the html part), by just dumping whatever HTML div Facebook asking us to put.
Sign In or Register to comment.