2012-01-24 48 views
0

按照的Gigya Comments plugin developer documentation ..gigya〜評論插件〜默認模板?

模板是一組相關的圖形在插件 元件的佈局定義。該插件包含五個可定製的 模板。您可以爲每個模板分配一個HTML字符串, 重新定義其圖形佈局。的 '模板' 的 socialize.showCommentsUI方法的參數收到包含下列 字段的對象:

  • 評論
  • commentBox
  • loginCanvas_loggedIn
  • loginCanvas_loggedIn_guest
  • loginCanvas_loggedOut
每個字段是 一個可定製的模板。 每個字段都有一個默認值,您可以用 覆蓋。在下面...

那些模板的默認值是什麼?

回答

0

,你可以在這個例子中看到:

http://wikifiles.gigya.com/Socialize/CommentsUI_Example_Templates.htm

你只是建立HTML模板,並將其分配給一個JSON對象,並將其傳遞給的Gigya評論功能的則params的一部分:

var templates = { 

    commentBox: '<span style="color:blue;">This is the Login Canvas: </span><br>$loginCanvas<br><br>' + 

       '<span style="color:blue;">This is the Close Icon: </span>$closeIcon<br>' + 

       '<span style="color:blue;">This is the Add Comment text box: </span>$addComment', 

    comment:'Hello!<br>' + 

      '<span style="color:blue;">This is the username: </span>$username<br>' + 

      '<span style="color:blue;">This is the Photo Div: </span>$photoDiv<br><br><br>' + 

      '<span style="color:blue;">This is the Date String: </span>$dateString<br>' + 

      '<span style="color:blue;">This is the Comment Body: </span>$body<br>' + 

      '<span style="color:blue;">This is the Replies Count: </span>$repliesCountPlaceholder<br>' + 

      '<span style="color:blue;">This is the Reply Button: </span>$replyButton<br><br>' + 

      '<span style="color:blue;">This is the Flagging option: </span>$flag<br>' + 

      '<span style="color:blue;">This is the Voting option: </span>$vote<br><br>', 

    loginCanvas_loggedIn: '<span style="color:blue;">Login Canvas - Logged in state! </span><br>$photoDiv<br>$username<br>$logoutLink', 

    loginCanvas_loggedIn_guest: '<span style="color:blue;">Login Canvas - Guest user state! </span><br>$photoDiv<br>$username<br>$logoutLink', 

    loginCanvas_loggedOut: '<span style="color:blue;">Login Canvas - Logged Out state!<br></span>$photoDiv<br>$loginDropdown<br>$guestDropdown' 

} 



var params = 

{ 

    // Required parameters: 

    categoryID: 7623701, 

    containerID: 'commentsDiv', 



    // Optional parameters: 

    templates: templates, 

    streamID: 'foo6', 

    cid: '' 

} 

// Load the Comments Plugin 

gigya.socialize.showCommentsUI(params);