Joomla's default site template, Cassiopeia, loads a file called user.js on every page, and that is all the Yaplet widget needs. You create this file in the Joomla administrator, paste one block of code from Yaplet into it, and the chat button appears on your site. You don't need an extension.
This guide is for sites that use the Cassiopeia template, in Joomla 4 and newer. If your site uses a different template, ask the template's developer where your own JavaScript goes.
1. Copy your Yaplet code
In the Yaplet dashboard's left menu, go to Brand → (your brand) → Chat widget → Install. If the tab asks where your website runs, choose Other website and switch off Include the <script> and </script> lines. Copy the code with the copy button on the code block.
The code must be plain JavaScript that starts with !function (Yaplet, with no <script> tags around it. If what you copied starts with a <script> line, leave out that first line and the last </script> line. user.js is a JavaScript file, so the code goes in without the tags.
2. Open the template's files
In your Joomla administrator, go to System → Site Templates → Cassiopeia Details and Files. This opens the Templates: Customise (Cassiopeia) page with the template's folders and files.
If your site uses a child template of Cassiopeia, you can do the same in that template's Details and Files.
3. Create the user.js file
- Select the js folder. If
user.jsis already there, select it and go to step 4. - Select New File.
- In the dialog, select the js folder, otherwise the file ends up in the wrong place.
- Type
userin the File Name field and choose .js in the File Type field. - Select Create, then open the new
user.jsfile.
4. Paste the code and save
Paste the Yaplet code into user.js. If the file already has code in it, paste the Yaplet code at the end, on a new line. Then select Save.
5. Check your site
Open your site in a new browser tab and reload the page. The Yaplet chat button appears in the bottom-right corner. Click it to check that the chat opens.
For a full checklist, see Verify your installation.
If the chat doesn't appear
- The file is in the wrong folder. It must be
user.jsin the template's js folder (on the server:media/templates/site/cassiopeia/js/user.js). If it went somewhere else, create it again in the js folder. - You added
<script>tags. Remove them.user.jstakes plain JavaScript, and the tags stop the code from running. - Your site uses another template. Cassiopeia loads
user.js, but other templates may not. Ask your template's developer where your own JavaScript goes. - Joomla's cache still has the old pages. Go to System → Clear Cache (in the Maintenance panel), select all items with the checkbox in the column heading and select Delete. Then reload your site in a private window.
What's next
To see what the code does and where your widget ID is, read Install Yaplet.