최근 검색


최근 검색 없음

Suriyan Schock's Avatar

Suriyan Schock

가입한 날짜: 2021년 4월 16일

·

마지막 활동: 2022년 2월 02일

팔로잉

0

팔로워

0

총 활동 수

6

투표 수

0

플랜 수

2

활동 개요

님의 최근 활동 Suriyan Schock

Suriyan Schock님이 에 댓글을 입력함

커뮤니티 댓글 Discussion - Tips and best practices from the community

Hi, does anyone have the same problem with the CSS like we have with this type of announcement?
This type of message should be standard enough for the CSS to work properly but it doesn't, especially on different screen-sizes!

Does anyone have a suggestion to how I should fix this in the CSS file so longer announcement-texts can be displayed in a nice way rather than showing this kind of mess?

댓글 보기 · 2021년 4월 08일에 게시됨 · Suriyan Schock

0

팔로워

0

투표 수

0

댓글


Suriyan Schock님이 에 댓글을 입력함

커뮤니티 댓글 Discussion - Tips and best practices from the community

Hi, the only solution in my case turned out to be in the script.js file, the original one kept giving me "$ is not defined".

But with these added code-lines and changes to the original codes - It all now works properly!
This whole code-section is in its own scope and at the very bottom of the script.js file.

Note that using the labels "alert" or ""alert"" works just the same ( alert or "alert" typed in as label both works , just to clarify ).

I hope this info can help any other, that may come across the same issues that I've experienced before finally fixing it like this!
*********************************************************

// MW-Notification Banner
   function httpGetAsync(theUrl, callback)
{
    var xmlHttp = new XMLHttpRequest();
    xmlHttp.onreadystatechange = function() { 
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
            callback(xmlHttp.responseText);
    }
    xmlHttp.open("GET", theUrl, true); // true for asynchronous 
    xmlHttp.send(null);
}
function httpGet(theUrl)
{
    var xmlHttp = new XMLHttpRequest();
    xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
    xmlHttp.send( null );
    return xmlHttp.responseText;
}
  function alert( data ) { 
    console.log(JSON.parse(data).articles);
    var alertBox = document.querySelector(".alertbox");
    var articles = JSON.parse(data).articles
    articles.forEach((item, index) => {
      console.log(index);
      var style1 = '

' + item.title + '' + item.body + '

'
      console.log(style1);
      
      var newNode = document.createElement('div');
            newNode.innerHTML = style1;
      alertBox.appendChild(newNode);
      
    })
   
  };
  var url = "/api/v2/help_center/articles.json?label_names=alert";
  httpGetAsync(url, alert);

*********************************************************
Thank you for your efforts to help me at any rate:
Krista Martin , Kyle B and Alejandro Colon

댓글 보기 · 2021년 3월 12일에 게시됨 · Suriyan Schock

0

팔로워

0

투표 수

0

댓글


Suriyan Schock님이 에 댓글을 입력함

커뮤니티 댓글 Discussion - Tips and best practices from the community

Hi everyone,
I hope someone can help me with this!

I've been trying to implement this add-on on our website based on the Copenhagen theme many times over, following the instructions to the dot each time but I've been unsuccessful so far!

I keep getting the same error message in the console:

I can at least see the alert div-box when inspecting the site but that alert-box is totally empty and doesn't show anything, even though I've created many articles by now, with the label: "alert" and made it so that everyone should be able to see it, not only admins and agents.

I've also experimented with the ways I implement the codes, like for example, pasting the JS code at the very top or at the very bottom, nothing changes, still getting the very same error.

Has anyone else experienced this? Have I missed something?

댓글 보기 · 2021년 3월 05일에 게시됨 · Suriyan Schock

0

팔로워

0

투표 수

0

댓글


Suriyan Schock님이 에 댓글을 입력함

커뮤니티 댓글 Feedback - Help Center (Guide)

+1
This would be great to have as a native feature!

댓글 보기 · 2021년 3월 04일에 게시됨 · Suriyan Schock

0

팔로워

0

투표 수

0

댓글