Insert forum into a webpage | Google Group


You can embed a group into your website by using an iFrame and specifying the group's URL.


Setting Up iFrame
To embed a group in an external web page, copy and paste the following iFrame HTML into the web page's HTML source (make sure to change forum-name to your group name:



<iframe id="forum_embed"
 src="javascript:void(0)"
 scrolling="no"
 frameborder="0"
 width="900"
 height="700">
</iframe>

<script type="text/javascript">
 document.getElementById("forum_embed").src =
  "https://groups.google.com/forum/embed/?place=forum/forum-name" +
  "&showsearch=true&showpopout=true&parenturl=" +
  encodeURIComponent(window.location.href);
</script>
In the above example, you would want to change forum-name to the name of the group you want to pull into the iFrame. In addition, if you are pulling a group from a Google Apps domain (a site owned by an organization or a company), you will have to add a parameter at the end of the URL:
&domain=yourdomain.com
In the above example, you would replace yourdomain.com with the domain name for your group.

Customizing the display of your group

You can use other URL parameters to change the behavior of your iFrame and the display of your group:
  • showsearchtrue if you want to show a search box, false if you don't want the box to show
  • showtabstrue if you want to show the view selector tabs, false if you don't want to show tabs
  • theme: A value of default will use the default Google Discussions Forum theme instead of the monochrome embedded theme
  • hideforumtitletrue if you want to show the forum title and description, falseif you don't want to show the title or description
  • hidesubjecttrue if you want to hide the subject of the last post in My Forums view, false if you want to leave the subject visible
  • hl: The default language for the forum (if left out, Google will try to detect the user's chosen language)
  • fragmentstrue if you want to use fragments instead of query parameters for permalinks (for example, http://parenturl.com/path#forum instead ofhttp://parenturl.com/path?place=forum), false if you want to use query parameters
  • parenturl: The URL of the page embedding the iFrame (used to generate permalinks)
You can string together these parameters by separating them with an ampersand, &. For example, if you wanted to have an iFrame with a forum that showed the popout icons and had the Google Discussions Forum theme, your URL might be:
https://groups.google.com/forum/embed/?place=forum/forum-name&domain=yourdomain.com&showpopout=true&theme=default

0 comments:

Post a Comment