Skip to content
  • A place to talk about whatever you want

    4k Topics
    24k Posts
    FrankMF
    @[email protected] Thank you. Nice modification.
  • Stay tuned here to hear more about new releases and features of NodeBB!

    3k Topics
    19k Posts
    julianJ
    @[email protected] same shortcoming as finding the category for following, the handle isn't exposed. Also not all categories federate so whatever solution we adopt has to also communicate if a category is local only to the instance. @freamon
  • You have a cool idea about NodeBB? Post it here.

    833 Topics
    5k Posts
    KosiakK
    @DownPW said in Discouragement and user discipline: I have already had spammers who were big trolls and not spam bots :=) Ban hammer
  • Discussion regarding NodeBB Plugin development.

    2k Topics
    15k Posts
    <baris>B
    @duyanhstar, you can try something like this. I will post the changes I made to your code to get a result similar to below. Both the main post and reply have the same shortcode [embed-iframe] [{"name": "Video 1", "link": "https://www.youtube.com/embed/QZc7cZR0oGs?si=ZbhOVIZIRhiGLIFZ"}] but only the one in the main post is turned into an iframe. [image: 1739120026621-fb2af4fc-8c34-4b54-a7bd-9f5345a01dbd-image.png] in plugin.json, change the priority of filter:parse.post to 4, so that it runs before markdown { "hook": "filter:parse.post", "method": "parsePost", "priority": 4 } change parsePost method to the below, I added some comments. parsePost: async function (data) { // get post id of post that is being parsed const { pid } = data.postData; // get the topic id of the post const tid = await posts.getPostField(pid, 'tid'); // get main post id of this topic const mainPid = await topics.getTopicField(tid, 'mainPid'); // set isMainPid to true if the post being parsed is the main post const isMainPid = String(pid) === String(mainPid); // if parsing main post then replace shortcode with iframe if (isMainPid) { data.postData.content = EmbedCodeIframe.afterContentParse(data.postData.content); } else { // else remove shortcode data.postData.content = data.postData.content.replace(/^\[embed-iframe\].*$/gm, ''); } return data; return data; }, Remove { "hook": "filter:topic.get", "method": "getTopic" }, since it's not used anymore. Change the code that replaces the match in content so it doesn't turn into a code block due to leading whitespace. content = content.replace(matches[0], ` <div class="iocodes-container"> ${iframe} <div class="link-group"> ${items.map((item, idx) => `<button class="btn btn-link" data-iframe-id="${iframeId}" data-link="${makeAbsoluteUrl(item.link, item.domainTow ? domainTow : domain)}">${item.name}</button>`).join('')} </div> </div> `); I think that's all the changes I made, if you are seeing the iframe in widgets you can also hide them with the below custom css, [data-widget-area="sidebar"], [data-widget-area="header"], [data-widget-area="footer"] { .iocodes-container { display: none; } }
  • A public listing of community themes created by the NodeBB community.
    48 Topics
    1k Posts
    Jessica BrownC
    @baris Thank you, yeah I already did that, fork will make the modification once I move the main site's header over and put it in its breadcrumb area. Anyways, I really appreciate how quickly you respond, and will continue to do my addons over time.
  • Need help with installing or configuring NodeBB? Look here.

    5k Topics
    27k Posts
    julianJ
    @sweetp hmm we'd have to look into what is causing that. Best guess would be some sort of user protection to limit the scheme to https. Might be something could be added to the markdown plugin to allow additional schemes
Popular Tags

Online Users