HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

multiple comment embeding

can you embed multiple universal comments

Comments

  • KasparKaspar ✭✭✭

    Like quoting multiple in one comment?

  • no embed 2 universal comment embed codes but in different divs with different discussion ids

  • K17K17 ✭✭✭
    edited February 2021

    As I use a lot Embed Comments I may help you with this.

    You can have multiple embed comments, you just have to provide a unique ID in your code (such as, if you're on a blog, the article ID or things like this).

    As I'm using Vanilla comments over here:

    Here is the script I use:

    <script type="text/javascript">
    /*** Required Settings: Edit BEFORE pasting into your web page ***/
    var vanilla_forum_url = 'https://lebobbalibre.fr/forum/'; // The full http url & path to your vanilla
    var vanilla_identifier = 'lebobbalibre-##ARTICLE_ID##'; // Your unique identifier for the content being
    
    /*** Optional Settings: Ignore if you like ***/
    var vanilla_category_id = '14'; // Create this discussion in a specific Vanilla CategoryID.
    var vanilla_title = '<?php echo $plxShow->artTitle(); ?>';
    
    /*** DON'T EDIT BELOW THIS LINE ***/
    (function() {
    var vanilla = document.createElement('script');
    vanilla.type = 'text/javascript';
    var timestamp = new Date().getTime();
    vanilla.src = vanilla_forum_url + '/js/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(vanilla);
    })();
    </script>
    

    The vanilla_identifier is what will indicate to Vanilla wich page/article is shown.

    So I did put the name of my webstie followed with the article unique ID variable so like this:

    lebobbalibre-##ARTICLE_ID##
    

    where ##ARTICLE_ID## is the internal article ID variable of my blogging software. For exemple, if it's for article 1, the identifier will be 'lebobbalibre-1'.

    With that configuration; each article have it's own related discussion. And if you want two one the same page you can, as long as each identifier is different.

    Vanilla will check for this vanilla_identifier and look if there are a discussion linked to that identifier. If yes, it will display it to the user, if no it will automatically create a new one.

  • Thanks @K17

Sign In or Register to comment.