Communifire has been built from the ground up to be highly customizable and flexible -- so that you can get the most out of the platform.
You can use the Communifire API to add community content in your own external website as "widgets".
As a case study, let us assume you have a website that has been created in ASP.NET and that you would like to show the latest blog entries (from your Communifire installation) on your own home page. You can do this using the Communifire API.
Simply follow the steps mentioned below to implement it:
1. Copy paste the following DLLs in your project's /bin directory:
Note that all these DLLs are already strong-named, so you don't need to sign them.
2. Copy all the Communifire *.config files (like CFProviders.config etc) in your application directory. For Windows and console apps in .NET copy the *.config files to /bin folder and for Web Apps copy them just in your main application folder.
3. Open your project solution in Visual Studio, and make sure you add the Communifire.BL, and Communifire.Common DLLs (or other DLLs if you need them too) as references in your main Web project, using the "Add Reference" option. Also include the Communifire config files in your project.
4. Make sure that in your applications config file you have pointed to the Communifire connection strings file (CFConnectionStrings.config) and Communifire app settings file (CFAppSettings.config) as shown below:
<appSettings configSource="CFAppSettings.config" />
<connectionStrings configSource="CFConnectionStrings.config" />
If you do not add these entries in your own web.config file, you will get "Object reference not set" errors while trying to run your solution.
5. Add the following globalization tag inside the system.web section in the web.config of your web application.
<globalization resourceProviderFactoryType="Communifire.Providers.LocalizationProviders.DyveResourceProviderFactory, Communifire.Providers"/>
Below is the screenshot which will help you to know the position of that tag in web.config:
6. Add the following line in HttpModules section inside the system.web setcion of your web config
<add name="DyveHttpModule" type="Communifire.Web.Components.HttpModules.DyveHttpModule,Communifire.Web.Components"/>
7. Open the web form page in your application where you would want to show the latest blog entries, then add the relevant HTML to show the latest blog entries. You can use a repeater or a datalist -- modify the HTML to your desired look and feel. Sample example is as shown below:
<asp:Repeater ID="rptLatestCommunityPosts" runat="server" OnItemDataBound="rptLatestCommunityPosts_OnItemDataBound">
<li><a href='<%# CreateUserProfileUrl(Eval("UserName")) %>' title='<%#Eval("username")%>'>
<img alt='<%#Eval("username")%>' class="contentImg" id="userImage" runat="server" />
<asp:HyperLink ID="aBlogPostURL" runat="server" Text='<%#Eval("EntryTitle")%>'></asp:HyperLink>
<%# DateTime.Parse(Eval("DateCreated").ToString()).ToShortDateString()%></small><br />
<%# Communifire.Web.Components.Utilities.GetSummary(Eval("EntryText").ToString(), 255)%>
8. Then on the same page, open the code-behind and use the following code to pull the latest blog entries from your Communifire installation:
private void PoputaleTopNBlogPosts()
//get the spaceID from querystring, if there is no spaceID then pass 0
int spaceID = Convert.ToInt32(Request.QueryString("SpaceID"));
rptLatestCommunityPosts.DataSource = Communifire.BL.BlogEntryRepository.FindBlogEntries(spaceID, 5);
protected string CreateUserProfileUrl(object userName)
In the above code, we get the latest 5 (here N=5) blog posts using the API and then we are binding the results to the repeater control.
9. Run the project -- you should see the top 5 blog entries on your own webpage.
is requesting access to a wiki that you have locked: https://my.axerosolutions.com/spaces/5/communifire-documentation/wiki/view/79/how-to-access-communifire-components-in-your-own-website