SimplePortal

Support => English Support => Topic started by: masiaox on April 18, 2016, 02:57:47 PM

Title: Block not showing
Post by: masiaox on April 18, 2016, 02:57:47 PM
how can I show this as a html block?

it works fine on the preview but, it doesn't show on the front page and it's active.


Code: [Select]
<script type="text/javascript" src="http://discord.deliriousdrunkards.com/discord.min.js"></script>
<script type="text/javascript">
  discordWidget.init({
    serverId: '51143782082543616',
    title: 'Discord Widget Title',
    join: false,
    alphabetical: false,
    theme: 'dark',
    hideChannels: ['Channel Name 1', 'Channel Name 2'],
    showAllUsers: true,
    allUsersDefaultState: true
  });
  discordWidget.render();
</script>

<div class="discord-widget"></div>

Title: Re: Block not showing
Post by: emanuele on April 18, 2016, 03:47:52 PM
I just tried the code in a test install and it is shown apparently properly.
Are you sure permissions are set correctly?
Do you have it live somewhere so that I can have a quick look and see if works for for me?
Title: Re: Block not showing
Post by: Chen Zhen on April 18, 2016, 04:45:15 PM
You can attempt to invoke the .ready handler.
Code: [Select]
<script type="text/javascript" src="http://discord.deliriousdrunkards.com/discord.min.js"></script>
<script type="text/javascript">
$(function() {
discordWidget.init({
serverId: "51143782082543616",
title: "Discord Widget Title",
join: false,
alphabetical: false,
theme: "dark",
hideChannels: ["Channel Name 1", "Channel Name 2"],
showAllUsers: true,
allUsersDefaultState: true
});

discordWidget.render();
});
</script>
<div class="discord-widget"></div>

You're also using a script that dynamically loads a jQuery library.
Imo it may be better to put that script into your own file but remove the dynamic library load and load that library yourself (it should be first of the two).
Title: Re: Block not showing
Post by: masiaox on April 18, 2016, 10:25:29 PM
thanks, I placed the script in a file, works better like that but,  the problem was... somehow the block visibility wasn't applying for that block, I had to fix it editing the database
SimplePortal 2.3.8 © 2008-2024, SimplePortal