@julian Maybe this could just be the first one of a series, this one about why forum are important, and then others about why NodeBB is a good choice. I agree with you on competition, those video should not compare NodeBB to current competitors but rather to how forum used to be.
Ribesg
Posts
-
Didn't see this coming -
security problem?@bogus "normal" users like us only see "This post is deleted!" but admins will see the post content, so it's ok.
Actual deleted post for reference https://community.nodebb.org/topic/4033/security-problem
-
How can a theme modify the behaviour of NodeJS?@julian I think, yes, as this would have the same value than my own change.
-
NodeBB Template results in something completely wrong -
NodeBB Template results in something completely wrongOpened issue https://github.com/NodeBB/NodeBB/issues/2882
This is very strange and should be fixed. If it comes from me doing something invalid, it should output some error or warning somewhere. Something has to be done, whatever the cause of this is. -
NodeBB Template results in something completely wrongHi, I'm working on a theme extending Vanilla. See https://battle-realms.fr/.
I've got a problem where NodeBB generates something completely wrong on my hompage. Here's the associated template part:
<div class="content-container"> <img src="\{categories.children.posts.user.picture\}" class="pull-left img-circle" /> <a href="{relative_path}/topic/\{categories.children.posts.topic.slug\}<!-- IF categories.children.posts.index -->/\{categories.children.posts.index}<!-- ENDIF categories.children.posts.index -->"> <div> <div class="content">\{categories.children.posts.content\}</div> <div class="home-fade"></div> </div> </a> </div>
As you can see there's a
div
inside aa
here.
Now the result:<div class="content-container"> <img src="https://secure.gravatar.com/avatar/e0f46640ee183127e536c55b660aafe3?size=256&default=retro&rating=pg" class="pull-left img-circle"> <a href="/topic/5/téléchargements/2"> </a><div><a href="/topic/5/téléchargements/2"> </a><div class="content"><!-- SNIP --></div> <div class="home-fade"></div> </div> </div>
A complete mess. The
a
is closed before the thediv
it's supposed to contain starts, it inserted anothera
in thisdiv
(wtf?) and multiple other ones in the content.
You can see how wrong it looks on my mainpage, second post of first category in second section.
Here's a screenshot:
My question is, wtf is NodeBB doing here? How can I fix this?
EDIT: Added some
\
in the code snippets to prevent NodeBB from removing things in braces -
How can a theme modify the behaviour of NodeJS?Bumb, this single line of JS added is the onyl change I have to do to NodeBB's sources for my theme to work, would be nice if I could get rid of it!
-
Access Logged In user Information on Server side.@akumbhare the linked code is in
master
. You're certainly using thev0.6.x
branch. I don't see theuid
passed in thev0.6.x
branch. -
CPU utilization increased in 0.6.x@hek I used redis-cli to remove everything which was not a category, a topic, a post, a user. I had less than 20 entries for each of those things so it wasn't too hard to do by hand, of course you could automate this using some script.
Then I installed the new NodeBB normally, using that cleaned Redis DB as this instance DB. It just didn't add default categories as some where already there, but it worked. I was able to login and all posts were there.Of course you lose everything else, configuration, plugins, etc. But I think it's better. NodeBB is still a bit early to modify it too much. Plugins just started being versioned. The only thing really worth investing time in is theming, as long as you mainly do CSS and modify few templates.
I did that on a test separate instance of course (different redis instance on different port + nodebb instance clone running on different port).
-
CPU utilization increased in 0.6.x@hek for 4), I know that there was a change in themes that made a lot of CSRF error appear when upgrading. Somebody else should explain that better, as in the end I chosed to take a clean start (fresh v0.6.x clone and cleaned redis DB).
-
How can a theme modify the behaviour of NodeJS?Hi.
In my theme, I want to modify the breadcrumb on pages like the category page and the topic page so that the top-level category is not a link.
For example in the following breadcrumb, I wantHome
,B
andC
do be links, butA
andD
to be simple text:Home > A > B > C > D
My problem is that the
breadcrumb.tpl
doesn't "receive" the required data to be able to see which breadcrumb entry is what in the loop.I want to modify (replace) the
helpers#buildCategoryBreadcrumbs
function with my theme.
The idea is too add the category's parent CID to each breadcrumb entry, so that I could check if it exists in the template to see if it's a top-level category.How could I do that?
- I'm not sure if it's a good thing if it's in NodeBB itself, so I don't know if I should make a PR for it
- I don't know if a theme is able to replace js files like that
- I don't know if a plugin (as themes are plugins afaik) can do that either
Thanks
EDIT: For now, I've got this:
breadcrumb.tpl
in theme:
<ol class="breadcrumb"> <!-- BEGIN breadcrumbs --> <li itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb" <!-- IF @last -->class="active"<!-- ENDIF @last -->> <!-- IF !@last --><!-- IF !breadcrumbs.isTopLevelCategory --><a href="{breadcrumbs.url}" itemprop="url"><!-- ENDIF !breadcrumbs.isTopLevelCategory --><!-- ENDIF !@last --> <span itemprop="title"> {breadcrumbs.text} <!-- IF @last --> <!-- IF !feeds:disableRSS --> <!-- IF rssFeedUrl --><a target="_blank" href="{rssFeedUrl}"><i class="fa fa-rss-square"></i></a><!-- ENDIF rssFeedUrl --><!-- ENDIF !feeds:disableRSS --> <!-- ENDIF @last --> </span> <!-- IF !@last --><!-- IF !breadcrumbs.isTopLevelCategory --></a><!-- ENDIF !breadcrumbs.isTopLevelCategory --><!-- ENDIF !@last --> </li> <!-- END breadcrumbs --> </ol>
helpers#buildCategoryBreadcrumbs
insrc/controllers/helpers.js
helpers.buildCategoryBreadcrumbs = function(cid, callback) { var breadcrumbs = []; async.whilst(function() { return parseInt(cid, 10); }, function(next) { categories.getCategoryFields(cid, ['name', 'slug', 'parentCid'], function(err, data) { if (err) { return next(err); } breadcrumbs.unshift({ text: validator.escape(data.name), url: nconf.get('relative_path') + '/category/' + data.slug, isTopLevelCategory: data.parentCid == 0 ? 1 : 0 }); cid = data.parentCid; next(); }); }, function(err) { if (err) { return callback(err); } breadcrumbs.unshift({ text: '[[global:home]]', url: nconf.get('relative_path') + '/' }); callback(null, breadcrumbs); }); };
-
Problem with navigation and container/container-fluidIn the end, here are the only changes (to the original theme) I did to successfully achieve what I wanted without bug:
- Change
container
tocontainer-fluid
inheader.tpl
to set the "default" format to fluid. - For each page that I want to be non-fluid, wrap the whole
***.tpl
into a<div class="container"></div>
.
For example I did this forcategory.tpl
,topic.tpl
,register.tpl
andlogin.tpl
.
It works.
- Change
-
Problem with navigation and container/container-fluidWell, a client side Javascript would make the page change after it loaded, I don't want that.
The problems I found with my currently implemented solution are that I've got an horizontal scrollbar (I should be able to fix that with some CSS somehow) and it seem to add another
#content
div when browsing... Which is wrong... -
Problem with navigation and container/container-fluidEh, my idea was correct I think. It seems that the browsing replace the content of
#content
with the other page#content
, so splitting that into 2 divs works. Can anyone confirm this is how it works? -
Problem with navigation and container/container-fluidHi
I made my own theme as a fork of Lavender. To be able to have different "container" content classes on different pages, I moved the two following lines from the end of
header.tpl
tohome.tpl
,category.tpl
andtopic.tpl
.<div class="container" id="content"> <!-- IMPORT partials/noscript/warning.tpl -->
Now, in
home.tpl
only I replacedcontainer
bycontainer-fluid
.
My problem is that When I'm in browsing from a topic or a category to home (hitting the Home item in the breadcrumb), the layout doesn't change, and I see the home page withcontainer
instead ofcontainer-fluid
.What should I do? Would separating the
#content.container
div into 2 levels of divs (#content
containingcontainer
) work? -
NodeBB Developer AMA/Meet & Greet (Monday, June 16th, 2014)That's because there are far too many bugs.
#ShotsFired
#WeNeedAHashtagParsingPlugin
#ItsAJoke -
New from-scratch themeOpened an issue. Getting rid of Bootstrap is currently close to impossible without modifying NodeBB.
-
"Error: Post content was flagged as spam by Akismet.com"Was finally able to post, just had to remove the HTML from the post content ._.
You should fix this, not being able to post HTML on this forum may be a problem, especially in the theme section
-
New from-scratch themeI'm working on the topbar right now and I already encounter a problem.
This "navigation" part is defined like this in the Vanilla theme
As I'm not using Bootstrap at all, the value for{navigation.iconClass}
is not valid.{navigation.iconClass}
is the Font Awesome Icon class. Unfortunately, Semantic UI renamed the classes from the originalfa-xxx
pattern to something more human.Any ideas on what I could do? Replacing the icons with JS feels really wrong...
I also don't want to make my own version of NodeBB, I'm just making a theme...It's a "mobile-mode" thing so I could just ignore it and see later, I don't know.
EDIT: Was finally able to post, just had to remove the HTML from the post content ._.
-
"Error: Post content was flagged as spam by Akismet.com"I'm trying to post on my topic but I can't because of this error.