aneeeshp
Posts
-
where is the api docs for nodebb? -
Custom template for a particular topic@pitaj Thank you. Issue was with the condition. I have used condition as shown below which solved the problem.
post.posts[0].tid === 1090
-
Custom template for a particular topicThank you all for the suggestions. I tried @PitaJ `s solution. This is what I have done:
In library.js in my custom theme, I added:
benchpress.registerHelper('isTaskList', function (post) { return post.tid === 1090; });
In lib/persona.js in my custom theme, in the $(document).ready event, i added:
templates.registerHelper('isTaskList', function (post) { return post.tid === 1090; });
And then in the templates/partials/topic/post.tpl, I have used:
<!-- IF function.isTaskList -->
as the condition
The condition is working as expected when the page is initially loaded for the posts that are loaded/displayed initially, however when I scroll down and when the further posts are getting loaded/displayed at the bottom of the page, the condition is not taking into effect. Could you please advise if something is missing?
-
Custom template for a particular topic@julian Thank you for replying. I am thinking of a small hack in that case. Let me know if this will work. What if I create a custom route and use a modified version of the original topic.tpl as its template?
var controllers = require('./lib/controllers'), plugin = {}; plugin.init = function(params, callback) { var router = params.router; var middleware = params.middleware; // Define the function that renders the custom route. function render(req, res, next) { // Get data object corresponding to the specific topic. The topic ID is fixed. var data; // This is the path to your template without the .tpl, relative to the templates directory in plugin.json var template = 'my-custom-page' // Send the page to the user. res.render(template, data); } // This actually creates the routes, you need two routes for every page. // The first parameter is the actual path to your page. router.get('/my-custom-page', middleware.buildHeader, render); router.get('/api/my-custom-page', render); callback(); }; module.exports = plugin;
'data' needs to be filled with information about a specific topic. If this is possible, then how can I get the data object corresponding to a particular topic in the render function? Is there some function that can take a topic id as input and just return 'data'?
-
Custom template for a particular topicIs it possible to have a custom template for a particular topic (identified by a topic id)? Something like topic_tid.tpl somewhere in a plugin or theme? My intention is to be able to theme a specific topic and leave the remaining use the default topic template.
-
NodeBB WebView App v3This app helps a lot. It works well with OneSignal notifications as well. But one doubt. When sending notification from OneSignal, when user clicks on the notification in mobile, can they be redirected to a page in the app?
-
How to use Write API to chat with user in a chat room@yariplus Thank you. This helps a lot.
-
How to use Write API to chat with user in a chat roomCan it be achieved with some code changes in writeapi plugin? Could you help me with some starting point in code to achieve this?
-
How to use Write API to chat with user in a chat roomHi,
I tried to user Write API`s chat route /api/v1/users/<uid>/chats in order to chat with user using a bot. However every time when I am sending a message, it is creating a new chatroom. The POST operation onto /api/v1/users/<uid>/chats is creating a chat room & returning its id.{"code":"ok","payload":{"content":"<p>Hello</p>\n","timestamp":1498844643722,"fromuid":18,"roomId":8,"messageId":133,"fromUser":{"username":"mbatious","userslug":"mbatious","picture":"/uploads/profile/18-profileimg.png","status":"offline","uid":18,"icon:text":"M","icon:bgColor":"#f44336"},"self":1,"timestampISO":"2017-06-30T17:44:03.722Z","newSet":true,"cleanedContent":"Hello\n","mid":133}}
However I am not finding a way use this roomId in further messages. The only parameters accepted in /api/v1/users/<uid>/chats API are message, timestamp & quiet. How to continue chat in a previously created room?
-
Error while using piwik tracking code in custom headerI tried to use the code mentioned in this topic, but am getting an error in console. Webpage where I added the code is: https://www.mbatious.com/recent
Error:
_paq.push() was used but Piwik tracker was not initialized before the piwik.js file was loaded. Make sure to configure the tracker via _paq.push before loading piwik.js. Alternatively, you can create a tracker via Piwik.addTracker() manually and then use _paq.push but it may not fully work as tracker methods may not be executed in the correct order. ["setCustomUrl", "https://www.mbatious.com/recent"]Can anybody help me come out of this?
-
Who is using NodeBB?We just started using NodeBB for our community https://www.mbatious.com/
NodeBB is rocking with an amazing user experience.
-
Is there way to make a topic part two categories at the same time?@PitaJ Okay. Let me check if I can accommodate my requirement in some other way. Will come back to you if needed. Thank you.
-
Is there way to make a topic part two categories at the same time?@PitaJ Thank you for the response. I can explain why I need this in more details. I have a website made using Drupal and I am trying to migrate to nodebb. In the existing site, there are small groups and every group contain a set of people. People in the group have permission to post content inside the group and any user can view the content.
Now there is a bigger group which is a common to all place and this is where almost every users in the website is a member of. So if a smaller group want their content to be promoted to a bigger audience (but still wanted to be part of their smaller group for better content organization), they typically post the content in their small group and share it with the big group so that members of big group also get notified.
I am trying to make a similar setup in nodebb using categories + groups. So there will be a category that is open to all (let`s call it 'global category'), anybody can post in that category, and we expect that lot many users will watch this category. Now there will be another category, let us call it 'small category' and a group 'small group'.Only users in 'small group' can post to 'small category'. So 'small category' acts as the place where 'small group' can organize their content. But some of the content they post there also need to be made part of 'global category' so that the content gets displayed in both the category pages and users watching the 'global category' also gets notified,
-
Is there way to make a topic part two categories at the same time?I would like to make a topic part of two categories at the same time. By doing so the topic should get listed in the category pages of both the categories. Also a notification should go to the users watching both the categories. Is it possible to do with some settings/plugins? If not, then can anyone guide me with a starting point to write a new plugin for this?