• Home

Comment Section Documentation

Requirements

Before starting your integration you will need to first create a vastvids account. Secondly, you will need to obtain your account's Api Key & add your accepted domains to your account. You will find your Api Key in your Settings > Admin Dashboard > Account > API Credentials. You will add your accepted domains in your Settings > Admin Dashboard > Comments > My Domains.

Comment Section HTML & Javascript

Include the following code in your html body. Set the values of the data-comment-apikey with your vastvids account's apikey. Set the data-comment-category with the category of your model (example: videos, articles, or products). Set the data-comment-identifier with the identifier of your model object (example: id or unique key). You can also change the background color and text color of the login button with the data-comment color attributes. There is a working example displayed in the code box below.

        
            
<body>

<!-- example of how to set up comment section div -->
<div class="comment-section" data-comment-apikey="LXYITnDgGBbFvyWasfda" data-comment-category="videos" data-comment-identifier="5" data-comment-button-background-color="purple" data-comment-button-color="white"></div> 
<!-- 
apply the class "comment-section" to your html div.
Than inside data-comment-apikey put your vastvids api_key. 
Than inside data-comment-category category of the post (example: videos, articles, product). 
Than inside data-comment-identifier put the object identifier (example: id, pk, or unique key), we used the id of 5 for example but it can also be a string. 
Than inside data-comment-button-background-color set the background color of the login button
Than inside data-comment-button-color set the color of the login button letters
-->

<!-- must be at button of other SDK code -->
<script type="text/javascript" src="https://vastvids.com/static/javascript/comment_section.js"></script>

</body>
              
          
      

Comment Count

To get the comment count include the following code in your html body. After including the code, the comment amount will be applied to any element with the class "comment-amount" & the identifer, apikey, & category applied to the data-comment attribute. There is a working example displayed in the code box below.

      
          
<body>

<!-- example of how to get comment amount of a model object -->
<span class="comment-amount" data-comment-apikey="LafdHfsnHfKbdH" data-comment-category="videos" data-comment-identifier="5"></span> 
<!-- 
apply the class "comment-amount" to your html element. 
Than inside data-comment-apikey put your vastvids api_key. 
Than inside data-comment-category category of the post (example: videos, articles, product). 
Than inside data-comment-identifier put the object identifier (example: id, pk, or unique key), we used the id of 5 for example. 
-->

<!-- must be at button of other SDK code -->
<script type="text/javascript" src="https://vastvids.com/static/javascript/comment_count.js"></script>

</body>
            
        
    

Ajax With Comment Count

If your using ajax to load elements that display comment counts, you will need to call the getVastCommentCount() function to refresh the comment count. Just include the following script in the HTML page that is being loaded through ajax.

      
          
<body>

<script type="text/javascript">
  getVastCommentCount();
</script>

</body>
            
        
    

Adding Blocked Words

You may add blocked words to your comment section via Settings > Admin Dashboard > Comments > Blocked Words. You may also specify a specific domain to block words if you use the same vastvids account for VastComments across multiple domains.

Transfering Comments Between Accounts

If you need to transfer comment ownership between vastvids accounts for any reason including but not limited to deletion, you can do so by setting a Comment Restore Password in your Settings > Admin Dashboard > Comments > Comment Restore Password. Whenever you need to transfer comments, just login to the new account head to Settings > Admin Dashboard > Comments > Restore Comments and enter the domain name and Restore Comment Password to transfer comment ownership to the new account. If you were using multiple domains for one vastvids account than you would have to do so for every domain.

All Done

There you go! Your set to go in a few easy steps.

© Copyright, VastComments