![]()
![]()
![]()
![]()
![]()
![]()
![]()
JavaScript Syndication
Hosting & Syndication
Syndication can be a very powerful tool if you are a hosting company. The JavaScript used to post syndicated content can be inserted into ASP, HTML, CFM, or any other types of templates.
If you host many Web sites, you can create a special place on each site to display syndicated content. For example, you could include up-to-date pricing for your services, information about your hosting company, etc.
When you implement this feature, the possibilities become endless, and the time required to update each Web site is drastically reduced.
In the diagram above, the Ektron site is displayed as the hosting company's Web site, while the sample site is the Web site where the content is also displayed.
Setting up a Syndicated Template
Before a Web site can use your content, you must set up your Ektron CMS400.NET Web site to send out the content.
The template used to syndicate the content is left blank except for the code that handles the syndication. This is done so that the content being displayed on the other server only shows content from the content block, and no other images that might change the look and feel of the Web site.
To do this, create an Ektron CMS400.NET template that includes the following custom tag and nothing else.
<%option explicit%> <!-- #include file=" web.config" --> <% dim currentUserID, jsObj Dim cConts, conObj Dim ErrString, id, Site IF (request.cookies("ecm").HasKeys) THEN currentUserID = request.cookies("ecm")("user_id") Site = request.cookies("ecm")("site_id") else currentUserID=0 Site = "" end if Set jsObj = CreateObject("Scripting.Dictionary") jsObj.Add "Browser" , Request.ServerVariables("http_user_agent") jsObj.Add "ServerName" , Request.ServerVariables("SERVER_NAME") jsObj.Add "ResolveImgPath" , TRUE jsObj.Add "ResolveHrefPath" , TRUE jsObj.Add "jsPath",Request.ServerVariables("HTTP_REFERER") jsObj.Add "ContentID", Request.QueryString("id") Set conObj = CreateObject("EkBrMach4Content.EkMach4Content") if (Request.QueryString("id") <> "") then Set cConts = conObj.jSyndication(AppConfStr, currentUserID, jsObj, Site, ErrString) if (cConts.Count) then %> document.writeln('<% Response.write( Replace(cConts("ContentHtml"),chr(13),"');document.writeln('") ) %>'); <% end if end if Set jsObj = nothing %>Ektron CMS400.NET provides a special template named jsyndication.aspx. This template has no images, just the custom tag seen above. It is all that is needed to allow other servers to display your content.
![]()
![]()
![]()
![]()
![]()
![]()
![]()