davidhayden-ci - LiveChat.OrchardCore 1.0.0-rc2-8

Provides settings for adding live chat functionality to website.

PM> Install-Package LiveChat.OrchardCore -Version 1.0.0-rc2-8 -Source https://www.myget.org/F/davidhayden-ci/api/v3/index.json

Copy to clipboard

> nuget.exe install LiveChat.OrchardCore -Version 1.0.0-rc2-8 -Source https://www.myget.org/F/davidhayden-ci/api/v3/index.json

Copy to clipboard

> dotnet add package LiveChat.OrchardCore --version 1.0.0-rc2-8 --source https://www.myget.org/F/davidhayden-ci/api/v3/index.json

Copy to clipboard
<PackageReference Include="LiveChat.OrchardCore" Version="1.0.0-rc2-8" />
Copy to clipboard
source https://www.myget.org/F/davidhayden-ci/api/v3/index.json

nuget LiveChat.OrchardCore  ~> 1.0.0-rc2-8
Copy to clipboard

> choco install LiveChat.OrchardCore --version 1.0.0-rc2-8 --source https://www.myget.org/F/davidhayden-ci/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "davidhayden-ci" -SourceLocation "https://www.myget.org/F/davidhayden-ci/api/v2"
Install-Module -Name "LiveChat.OrchardCore" -RequiredVersion "1.0.0-rc2-8" -Repository "davidhayden-ci" -AllowPreRelease
Copy to clipboard

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.

  • .NETCoreApp 3.1
    • OrchardCore.Admin.Abstractions (>= 1.0.0-rc2-13450)
    • OrchardCore.Deployment.Abstractions (>= 1.0.0-rc2-13450)
    • OrchardCore.DisplayManagement (>= 1.0.0-rc2-13450)
    • OrchardCore.Module.Targets (>= 1.0.0-rc2-13450)
    • OrchardCore.Navigation.Core (>= 1.0.0-rc2-13450)
    • OrchardCore.ResourceManagement.Abstractions (>= 1.0.0-rc2-13450)
  • .NETCoreApp 3.1: 3.1.0.0

Owners

David Hayden

Authors

David Hayden

Project URL

https://github.com/davidhayden/LiveChat

License

MIT

Tags

Chat LiveChat OrchardCore

Info

3 total downloads
3 downloads for version 1.0.0-rc2-8
Download (27.95 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
1.0.0-rc2-8 27.95 KB Fri, 24 Jul 2020 14:44:49 GMT 3