Code Monkey home page Code Monkey logo

livechat's Introduction

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.

livechat's People

Contributors

davidhayden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

livechat's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.