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.

  • @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?

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

  • @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

  • @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.

  • @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 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 on

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
  • Custom html in nodebb to prevent cache

    Unsolved Configure
    18
    2 Votes
    18 Posts
    863 Views
    @Panda You’ll need to do that with js. With some quick CSS changes, it looks like this [image: 1690796279348-d619844f-fbfe-4cf1-a283-6b7364f6bf18-image.png] The colour choice is still really hard on the eye, but at least you can now read the text
  • Smart Widgets

    Solved Configure
    9
    3 Votes
    9 Posts
    523 Views
    @Panda said in Smart Widgets: So why is that, or conversely why would the function to expose username ever be required, as it seems app.user is already an available global object? It is, yes, but not if you are using it outside of a widget. The function I wrote is also historical and comes from the 2.x train
  • Further Widgets question

    Solved Configure
    4
    1
    1 Votes
    4 Posts
    281 Views
    @Panda category is for a category in its own, so for example, “fruit” whereas categories is the page that contains all categories as a list.
  • NodeBB: Consent page

    Solved Configure
    16
    4 Votes
    16 Posts
    1k Views
    @DownPW I still do not see any issues.
  • NodeBB: Privileges for the Announcement channel

    Solved Configure
    6
    1
    1 Votes
    6 Posts
    344 Views
    Up to you really
  • background color of the footer area

    Solved Customisation
    7
    1
    7 Votes
    7 Posts
    571 Views
    @phenomlab thank you very much
  • NodeBB 1.19.3

    Solved Performance
    33
    4 Votes
    33 Posts
    3k Views
    @phenomlab I find the problem Mark The error message indicated this path : http://localhost:4567/assets/plugins/nodebb-plugin-emoji/emoji/styles.css?v=6983dobg16u I change the path url on config.json [image: 1645128773854-47bacc80-f141-41e4-a261-3f8d650cc6f6-image.png] And all it’s good Weird, I didn’t have to change that path before 1.19.3 But this does not prevent the problem from a clean install with Emoji Plugin EDIT: After test, that resolv the problem installation for 1.18.x but not for 1.19.x (I have other error message when I run ./nodebb Setup For resume: NodeJS 16_x with 1.18.x is ok
  • nodebb dropdown menu

    Solved Configure
    5
    1
    0 Votes
    5 Posts
    590 Views
    @phenomlab said in nodebb dropdown menu: @kurulumu-net You set it like the below example taken from this site [image: 1637939951821-aae36790-3257-4bb2-ad5a-0d744309876a-image.png] Which presents this [image: 1637939983445-77f47260-2941-4afe-9614-8e17dcfc8c19-image.png] Very interesting… I actually thought this wasn’t possible, as I remember it being asked in the NodeBB forum. Is this something new that’s been implemented? I’ll 100% be doing that when I’m on the laptop over the weekend.