{"id":144,"date":"2020-08-25T20:05:57","date_gmt":"2020-08-25T20:05:57","guid":{"rendered":"https:\/\/doc.dialogity.com\/index.php\/docs\/test-doc-site\/hide-chat-on-selected-pages\/"},"modified":"2020-08-25T20:17:48","modified_gmt":"2020-08-25T20:17:48","slug":"hide-chat-on-selected-pages","status":"publish","type":"docs","link":"https:\/\/doc.dialogity.com\/index.php\/docs\/test-doc-site\/hide-chat-on-selected-pages\/","title":{"rendered":"Hide chat on selected pages"},"content":{"rendered":"\n<p class=\"ticss-a456aefa\">If there are some pages on your website where you don&#8217;t want to include Dialogity chat, you can do it by setting a JavaScript variable before the chat is loaded, for example, in the code snippet which is loading the live chat.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n&lt;script>\r\n  window._chb_mainColor = '#16519F';\r\n  window._chb_uuid = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';\r\n  window._chb_lang_code = 'HUN';\r\n  if (window.location.href.includes('url_part_where_hide')) {\r\n    window._chb_disable = true;\r\n  }\r\n&lt;\/script>\r\n&lt;script src=\"\/\/js.dialogity.com\/main.js\" async=\"true\">&lt;\/script><\/code><\/pre>\n\n\n\n<p class=\"ticss-39e7902a\">The important part here is the line <strong>&#8216;window._chb_disable = true;&#8217;<\/strong>. On pages where this variable is set, the chat won&#8217;t be displayed.<\/p>\n\n\n\n<h5 class=\"ticss-fdccc2c2 wp-block-heading\">Hiding welcome message only<\/h5>\n\n\n\n<p class=\"ticss-534cb7f2\">Similarly, there can be pages where for some reason, you want to keep the chat functionality, but you don&#8217;t want to display the welcome message. To get this result just include <strong>&#8216;window._chb_nowelcome<\/strong> <strong>= true;&#8217;<\/strong> instead of <strong>&#8216;window._chb_disable = true;&#8217;<\/strong> on the selected pages.<\/p>\n","protected":false},"featured_media":0,"parent":11,"menu_order":2,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-144","docs","type-docs","status-publish","hentry"],"comment_count":0,"_links":{"self":[{"href":"https:\/\/doc.dialogity.com\/index.php\/wp-json\/wp\/v2\/docs\/144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doc.dialogity.com\/index.php\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/doc.dialogity.com\/index.php\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.dialogity.com\/index.php\/wp-json\/wp\/v2\/comments?post=144"}],"version-history":[{"count":2,"href":"https:\/\/doc.dialogity.com\/index.php\/wp-json\/wp\/v2\/docs\/144\/revisions"}],"predecessor-version":[{"id":146,"href":"https:\/\/doc.dialogity.com\/index.php\/wp-json\/wp\/v2\/docs\/144\/revisions\/146"}],"up":[{"embeddable":true,"href":"https:\/\/doc.dialogity.com\/index.php\/wp-json\/wp\/v2\/docs\/11"}],"prev":[{"title":"Multi language setup","link":"https:\/\/doc.dialogity.com\/index.php\/docs\/test-doc-site\/multi-language-setup\/","href":"https:\/\/doc.dialogity.com\/index.php\/wp-json\/wp\/v2\/docs\/86"}],"wp:attachment":[{"href":"https:\/\/doc.dialogity.com\/index.php\/wp-json\/wp\/v2\/media?parent=144"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/doc.dialogity.com\/index.php\/wp-json\/wp\/v2\/doc_tag?post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}