Changes to Lavender theme - few issues.

Moved NodeBB Development
  • HI guys, I really like the Lavender theme, so have decided to modify it. One issue I'm having is with embeds appearing on the forum home page. I have the soundcloud embed tool active on a forum where people post mixes.

    In home.tpl file:

    <p>{categories.posts.content}</p>

    The issue I'm having is that the embed is adding it's own paragraph tags. This causes the rest of the thread (the tracklisting) to fall outside of the paragraph tags inside home.tpl, and as such the max-height class associate with .post-preview p {} doesn't apply, I've looked in the soundcloud plugin, and it only adds the iframe from what I can see, so something else must be adding the paragraph tags.

    In addition, is there anyway to actually have the soundcloud widget embed on this homescreen, rather than just showing the URL? 🙂 Or any other alternatives?

  • The paragraph tags probably come from the markdown plugin -- the order in which the post.parse filter is applied:

    1. Markdown
    2. Embed plugins

    So markdown sees the raw url, and adds <p> tags around it, and then the embed plugin turns it into the <iframe... code.

    If it's bleeding through the container, have you tried setting wmode on the container to opaque? Not sure if that would do it...

  • Hey @julian

    I can confirm it is something in the essentials plugins pack that's causing it. I've tried a few changes, but nothing I've done has helped. Everything after the embedded iframe falls outside of p tags, so I can't do anything with it.

    From what I can work out, my options are to either stop the markdown from wrapping the raw URL in <p> tags. Or I add {categories.slug} to the div class and create a custom css rule for the mixes recent posts to not show the preview on the homepage. 2nd option sounds easy enough, but the 1st would be preferred.

    I should really learn markdown. I'm struggling to do anything. 😆 I'm so used to BBcode coming from SMF.

  • Can you post a screenshot of what happens when you try embedding video on a home page?

  • HI @julian,

    I have attached the screenshot below, the mixes category is the one that's causing me issues. I have also included the raw HTML below so you can see how it's affecting the p tags. General discussion is how it should look. Ideally with the soundcloud embedded. But that's another issue I can deal with later.

    http://i.imgur.com/F6zTbJr.jpg


Suggested Topics


  • 0 Votes
    3 Posts
    433 Views

    Thanks for the help and sorry if the "terrible" word hurts your feeling, I didn't mean to.

    @PitaJ said in the issue of benchpressjs:

    First off, calling their work "terrible" is a really bad strategy if you're trying to get help from someone. I'll still help, because I like being helpful, but please don't act this way in the future.

    #1. about Interpolation, benchpressjs does NOT allow to retrieve array by index, like this:
    <h1>{localNews.topics[0].title}</h1>

    If you're trying to just get a specific single element of an array, you just put the number as the property name, like so:

    <h1>{localNews.topics.0.title}</h1>

    I see this isn't documented, so I'll open an issue to document this behavior.

    #2, about helper function, I created one like this:
    Benchpress.registerHelper('getByIndexInArray', function (arrayData, i) {
    return arrayData[i];
    });

    and call this helper function like this:
    <h5>{getByIndexInArray(localNews.topics, 1)}</h5>

    But it seems like the index "i" can not be passed into the helper function, since in this helper function, I always got "i" as undefined.

    Your helper is correct, it's how you're calling it that's the issue. Benchpress doesn't have numeric literals, it only has string literals. Putting just 1 in there is telling Benchpress to look up the property "1" on the global object, and call the helper with that value (which is undefined in your case). Your helper will work if you call it like this instead:

    <h5>{getByIndexInArray(localNews.topics, "1")}</h5>

    I will also add a note to document this behavior in the paths and helper section.

    Issue is here: https://github.com/benchpressjs/benchpressjs/issues/89

  • 1 Votes
    3 Posts
    1k Views

    @pitaj said in Change username color by using CSS:

    What should the color be based on? It probably requires a theme modification.

    just on the username if it's possible.
    Or on the group, like admins username is red, mopderator username is green, gamers username is purple, etc.

  • 0 Votes
    6 Posts
    3k Views

    @alberto__segura said in Chat REST API endpoint changes:

    Also, I don't like the admins could directly read other users conversations

    It was removed and code moved to a plugin. So, admins can read other users conversations if the plugin is installed.

  • 3 Votes
    10 Posts
    8k Views

    0_1457071644710_nbb1.0.0.PNG

    No announcement thread in the announcements section?

    Congratulations, guys! NodeBB has come a long way.

  • 1 Votes
    2 Posts
    2k Views

    I'm unsure if I'm seeing a regression or an undocumented? change here.

    I'm currently getting:

    TypeError: undefined is not a function
    at /mnt/Extra/home/dbolack/Projects/nodebb-plugin-rscloudfiles/index.js:203:4

    Which maps to:

    callback(null, { url: rsCloudFilesCDNSecure + '/' + image.name, name: image.name || '' });

    Which is equivalent to the current imgur plugins bit:

    callback(null, { url: data.link.replace('http:', 'https:'), name: image.name || '' });

    Any ideas?