Skip to main content

Generating Script for Community Everywhere

With Community Everywhere, you can embed discussion threads directly into existing news articles, blog posts, or other content that would benefit from comments or discussions. This feature enables user engagement by allowing users to log in or create an account to participate in discussions without leaving the page that contains your content.

After you have enabled the Community Everywhere feature, you can use the Script Generator to create URLs that you can embed in your site.

Fastpath

Admin Console: Spaces > Settings > Community Everywhere

You can use the Script Generator section to generate the JS code for embedding.

There are options for the amount of content you can show:

  • Display "Discuss This" Link: Choosing this option results in only a link back to your community to a thread created from this piece of content. If a user posts a reply message, the reply and any other messages will not be displayed with the content.
  • Display "Discuss This" Link and Recent Posts: Choosing this option shows a link to your community to a thread created from this piece of content and shows the messages (if any) in the thread.
  • Display "Discuss This" Link, Recent Posts, and Comment Box: Choosing this option shows a link to your community to a thread created from this piece of content, shows the messages (if any) in the thread, and shows a comment box giving users the ability to create comments on the piece of content.

The Script Generator gives you four display options for the content generated from the choice you made about the content to display:

  • View Threaded: Enables you to choose the number of replies to be displayed alongside your content. The default is to display all the replies. Clear the check box to limit the number of replies to five, ten, fifteen, twenty, or twenty-five.
  • Show Discussion Statistics: Select this option to have Community Everywhere display the total number of replies and the date and time of the last reply. For example, the message could look like this: 2 message(s). Last at: Feb 28, 2007 12:48:36 PM.
  • Open Link in New Window: Select this option to have Community Everywhere force the opening of a new window when the user clicks on the Discuss This link.
  • Include Default Style (CSS): Select this option to have Community Everywhere include style markup by using CSS in the list of replies and comment box.

The Script Generator requires you to choose the space or community that you want the thread to be generated in and lets you generate a unique key for each piece of content.

After you've settled on all the options, you can copy the text in the Code section and paste it into the HTML of the content that you want the Community Everywhere feature to be embedded in. For more information, see Using Community Everywhere.

To embed the Community Everywhere feature into your content, follow these steps:

  1. Set up the feature in your community, as described in Setting up Community Everywhere.
  2. Generate the HTML code to be used on another site, as described above.
  3. Embed the generated code into the web page where you want to expose content from your community.

Finally, the Community Everywhere feature gives you the ability to choose a custom title and description for the thread that is automatically generated by the system. You can do this in one of the following ways:

  • By including two meta tags in the <head> of your document:

    <meta name="jiveTitle" content="A discussion about Tiles Foo"/>
    <meta name="jiveDescription" content="Add your thoughts about the Tiles Foo article below."/>
  • By including a snippet of JavaScript code in your document:

    <script language="JavaScript" type="text/javascript">
    var jiveTitle = "A discussion about Tiles Foo";
    var jiveDescription = "Add your thoughts about the Tiles Foo article below.";
    </script>

As an example, if you had an article about Tiles Foo on your site, you would go to the Admin Console, enable Community Everywhere, choose the content and display options you want, and click Generate New Key. You would then copy and paste the <script> tag from the Code section into your content. The end result would look something like this:

<p>
Tiles Foo is the greatest tool on the planet. You should buy one now.
</p>

<script language="JavaScript" type="text/javascript"
src="http://our-community/everywhere/1801?community=2003&key=TGFu9V">
</script>