【问题标题】:gigya ~ Comments plugin ~ default templates?gigya ~ 评论插件 ~ 默认模板?
【发布时间】:2012-06-18 13:42:22
【问题描述】:

根据 gigya Comments plugin developer documentation..

模板是一组相关图形的布局定义 插件中的元素。该插件包括五个可定制的 模板。您可以为每个模板分配一个 HTML 字符串 重新定义其图形布局。的“模板”参数 socialize.showCommentsUI 方法接收具有以下内容的对象 字段:

  • 评论
  • 评论框
  • loginCanvas_loggedIn
  • loginCanvas_loggedIn_guest
  • loginCanvas_loggedOut
每个字段都是 可定制的模板。 每个字段都有一个默认值,您可以 覆盖。在下面的 ...

这些模板的默认值是什么?

【问题讨论】:

    标签: templates gigya


    【解决方案1】:

    正如你在这个例子中看到的:

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

    您只需构建 html 模板,将它们分配给一个 json 对象并将它们作为参数的一部分传递给 gigya cmets 函数:

    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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-18
      • 2012-10-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多