Skip to content

davidhayden/LiveChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiveChat

LiveChat.OrchardCore is an Orchard Core CMS Module that provides the necessary settings to add script code from your live chat service to the website.

Status

Build status Status

Getting Started

Add the NuGet package, LiveChat.OrchardCore, to the Orchard Core CMS Website. Launch the website and sign in as an administrator to enable the module from the dashboard under Configuration -> Features.

LiveChat.OrchardCore

Add the script code from your live chat service to the settings area provided by the module, Configuration -> Settings -> Live Chat.

LiveChat.OrchardCore Settings

Make sure you check Enable to activate live chat and click Save to save the settings.

Visit the front-end of your website. The script code will be injected at the bottom of every non-admin page just above the closing body tag.

Troubleshooting

If your live chat service is not displaying on the website, here are some common problems.

  • Incorrect Script Code: Please double-check the script you entered into settings is correct and your live chat service is active and configured properly.
  • Live Chat Not Enabled: The Enable checkbox allows you to turn on and off live chat without removing the code. Make sure you have checked Enable.
  • Missing FootScript from Theme Layout: The script code is injected into the website using Orchard Core's ResourceManager. Verify your theme's layout is injecting resources of type FootScript.

See the Orchard Core Documentation for more information on Resources.

Customizations

The module is easily customizable. Here are a couple possible customizations depending on your needs.

Injecting Live Chat at Head of Page

If you prefer your live chat script be added within the head tag of the page instead of before the closing body tag, you can change the LiveChatFilter code to inject the code as HeadScript.

// _resourceManager.RegisterFootScript(content);
_resourceManager.RegisterHeadScript(content);

Requesting Live Chat Code Instead of Script in Settings

Many third-party plugins ask for a code, instead of a script, from the live chat service. These plugins are usually specific to a certain service and a bit more fragile since they need to be updated when the script they embed changes. Asking for a script avoids frequent updates and allows the module to support multiple live chat services.

However, you can modify the module to request a code in settings instead of a script by changing LiveChatSettings.Edit.cshtml. You can then embed the live chat service's script in the module and generate the script using the code before the call to _resourceManager.

var code = new HtmlString(settings.Text);
var content = GenerateScript(code);
_resourceManager.RegisterFootScript(content);

Road map

There is 1 planned enhancement:

  • Caching: Caching will be implemented using IMemoryCache.

Credits

LiveChat.OrchardCore is created and maintained by David Hayden.

About

LiveChat is an Orchard Core CMS Module that provides the necessary settings to add script code from your live chat service to the website.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published