As an Admin, you're able to add custom CSS or JavaScript to your community.
To do so, you should go to Admin Panel > Theme > Advanced Settings.
Under Advanced Settings tab, you can easily add Additional CSS as well as extra HTML to the end of <head />
or <body />
tags.
To add custom JavaScript you can easily add an <script />
tag to <head />
or <body />
. Here is an example of how it will look like:
<script>
console.log("Hello World!");
</script>
Custom Variables
Under <head />
or <body />
code you have access to the following information of logged in user:
- Name:
{{user.name}}
- Email:
{{user.email}}
- ID:
{{user.id}}
- External ID (if you're using SSO):
{{user.externalId}}
Having access to the above information let you pass user's information to third party scripts or snippets such as analytic tools, chat widgets, etc.
You can always send a default value for these variables using |
. For example:
<script>
console.log("Hi {{user.name|There}}");
</script>
The above script will log "Hi There" if user is not logged in.
Updated 9 months ago