Skip to content

Opening links in nodebb widget

Solved Configure
  • @phenomlab the convo we started on nodebb forum, I thought to continue it here.
    Still having the issue of links not loading often in widgets
    Have you been able to take a look?

  • A more efficient way of including this would be to not over complicate it and leverage a standard iframe (providing the CSP headers of the remote site permit this) like below

    <iframe src="https://www.classmarker.com/online-test/start/?quiz=gag66aea7922f0a5" width="700" height="800"></iframe>
    

    This works first time every time on your site as intended.

  • @Panda not yet, will do so later. For continuity, can you provide the code here that you want to use?

  • @phenomlab yes, its just a quiz.

    <script src="https://www.classmarker.com/public/js/embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5" data-quiz="gag66aea7922f0a5" data-width="700" data-height="800" ></script>
    

    The fact this is so problematic makes me wonder if something should be built into the widget code in nodebb to sort whatever the timing issue is, that causes loading to fail

  • @Panda I’ll test this and revert. Will get back to you later.

  • @Panda It’s not caused by NodeBB, but the way you are calling the URL - see the error message below reported in the console

    embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5:7  Uncaught TypeError: Failed to construct 'URL': Invalid URL
        at __createIframe (embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5:7:80)
        at load (embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5:3:100)
        at embed-classmarker-1.0.0.js?quiz=gag66aea7922f0a5:1:1
    
  • A more efficient way of including this would be to not over complicate it and leverage a standard iframe (providing the CSP headers of the remote site permit this) like below

    <iframe src="https://www.classmarker.com/online-test/start/?quiz=gag66aea7922f0a5" width="700" height="800"></iframe>
    

    This works first time every time on your site as intended.

  • phenomlabundefined phenomlab has marked this topic as solved

Did this solution help you?
Did you find the suggested solution useful? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation 💗

Related Topics
  • Unable to change icon in NodeBB navigation

    Tips
    1
    1 Votes
    1 Posts
    199 Views
    No one has replied
  • Nodebb 3.2.0

    Bugs
    20
    2 Votes
    20 Posts
    822 Views

    @crazycells yes, I’m aware of that. Need to fix

    EDIT- fixed. Caused by the same CSS that is used to absolutely position the “verified” group badge in the posts view. Amended this CSS so that is specifically targets the post stream as below

    li[component="post"] a[href*="/groups/verified"] { position: absolute !important; left: 8px; z-index: 2; margin-top: 1px; border-radius: 999px !important; line-height: 14px; display: block; height: 22px; margin-left: 0px !important; }
  • NodeBB: Consent page

    Solved Configure
    16
    4 Votes
    16 Posts
    756 Views

    @DownPW I still do not see any issues.

  • NodeBB: Upgrading to NodeBB v3.x

    Solved Configure
    6
    0 Votes
    6 Posts
    283 Views

    @mventures You’d need to connect to the server and execute it directly - not on your local terminal. Review the guide below, which will show you how to gain access via SSH to your server

    https://docs.ovh.com/gb/en/dedicated/ssh-introduction/

    Once you have access, you’ll need to navigate to the actual folder where NodeBB is installed

    You’ll then need to change to the directory as shown below

    /home/unbuntu/nodebb

    fdffe673-bf63-4b6d-a728-5506fddc1aff-image.png

    In most cases, initial access takes you to the root of the file system. You can always issue pwd in a Linux terminal which will show you the Present Working Directory. From there, you can issue the command

    cd /home/ubuntu/nodebb

    Once in the NodeBB directory, you’d use the below commands

    ./nodebb stop git fetch && git checkout develop && git reset --hard origin/develop ./nodebb upgrade ./nodebb start

    Line 1 stops the NodeBB instance
    Line 2 gets the latest files from GIT (repository) and then checks out the development branch. It then resets the version you are using to the development branch ready for v3
    Line 3 Runs the upgrade once the new branch is set, and code pulled
    Line 4 Restarts the NodeBB instance after the upgrade has completed

    Note that when you restart NodeBB and log back in, things will look very different to what you had in v2.

  • Custom badges

    Solved Customisation
    103
    49 Votes
    103 Posts
    10k Views

    Perfect 😉

  • MailGun Not Working NodeBB

    Solved Configure
    6
    1 Votes
    6 Posts
    433 Views

    @phenomlab did it 🙂 i did not create smtp user on mailgun. everything is working now.

    6cc6061f-ed5d-41f6-8eb7-5d98f98b3706-image.png

  • Recent Cards plugin customization

    Solved Customisation
    21
    13 Votes
    21 Posts
    2k Views

    @pobojmoks that’s easily done by modifying the code provided here so that it targets background rather than border

    In essence, the below should work

    $(document).ready(function() { $(window).on('action:ajaxify.end', function(data) { $('.recent-card-container').each(function(i) { var dataId = $(this).attr("data-cid"); var color = $('[role="presentation"]', this).css("background-color"); console.log("data-cid " + dataId + " is " + color); $('[data-cid="' + dataId + '"] .recent-card').attr("style", "background-color: " + color); }); }); });
  • Social icon (Nodebb)

    Solved Customisation
    7
    0 Votes
    7 Posts
    988 Views

    @phenomlab said in Social icon (Nodebb):

    @jac I just tested my theory around using the OG image, and according to the Twitter card validator, it works fine

    73e805e1-997b-41bf-9259-51c5052ca8fc-image.png

    fixed 🙂