Ok, so for example, if I wanted to get the js for the reply, favorite and upvote button functionatliy, where/how would I grab that script? I noticed the buttons all use the component system, so do I have to somehow include components.js in the new template? How would I go about doing that?
achou72
Posts
-
Embedded template buttons don't work -
Embedded template buttons don't work@pichalite I see. How would I go about doing that? Sorry if this is answered somewhere in the documentation, I'm new to nodebb and node.js in general and having a hard time grasping the ins and outs. Thanks!
-
Embedded template buttons don't workI have a hidden div in header.tpl that I'm trying to append the topic template into with this code:
require(['translator'], function (translator) { $.getJSON('/api/topic/8/', function (json) { templates.parse('topic', json, function (html) { translator.translate(html, function (translated) { $(translated).appendTo('.overlay-content'); $('#lb-overlay').css('display','block'); $('html').css('overflow-y','hidden'); }); }); }); });
I basically want to make it so that when you click a link to the topic itself, instead of displaying in the main window, it will open up this overlay div and display the topic info inside the div. The code above was taken from the topic I replied to in my opening post when another user tried to append the recent template into a sidebar. The topic content is displayed properly inside the div, but none of the buttons (reply, favoriting etc.) do not work inside the div. Is there more I need to do in order to render the template properly with full functionality inside the overlay? I can have an iframe inside the div pointing to the topic/url I want but I would rather not use that if there is a way to simply render the template inside a different div.
-
Embedded template buttons don't workRe: Importing tpl inside another tpl
I tried the method as outlined in this topic to embed the topic template into a div on my main page. The content displays just fine, however the links/buttons in the div (replying, favoriting etc.) do not work properly. Is there a way to render the template and have the buttons and links and such work inside the div? Thanks.