@dunlix said in Best NodeBB plugins?:
@anodetobb in the NodeBB settings (ACP) There is an option somewhere to open new links in new tabs. Maybe in settings>posts but not sure. On a desktop you can just middle click.
Thanks very much! ππ»
So, I left this for a week or two, just come back to it to see if I could get it working, checked my console.log and what do you know, I have progress, I now have the output that I need (albeit all of it, not just what I specified)
{"pagination": {"per_page": 1, "items": 1, "page": 1, "urls": {}, "pages": 1}, "results": [{"style": ["Breaks", "Electro", "Drum n Bass"], "thumb": "http://api.discogs.com/image/R-90-3071347-1314359516.jpeg", "format": ["CDr", "Album", "Promo"], "country": "UK", "barcode": [], "uri": "/Noisia-Split-The-Atom/release/3071347", "community": {"have": 12, "want": 10}, "label": ["Vision Recordings"], "catno": "VSNCD001P", "year": "2010", "genre": ["Electronic"], "title": "Noisia - Split The Atom", "resource_url": "http://api.discogs.com/releases/3071347", "type": "release", "id": 3071347}]}
So my question now is what would I use to get this into the template file?
I've done {results.catno} and used @julian's earlier method of looping through, but neither works. Any ideas?
I only need bits of the info inside results. Not the pagination bit.
{
"pagination":{
"per_page":1,
"items":1,
"page":1,
"urls":{
},
"pages":1
},
"results":[
{
"style":[
"Breaks",
"Electro",
"Drum n Bass"
],
"thumb":"http://api.discogs.com/image/R-90-3071347-1314359516.jpeg",
"format":[
"CDr",
"Album",
"Promo"
],
"country":"UK",
"barcode":[
],
"uri":"/Noisia-Split-The-Atom/release/3071347",
"community":{
"have":12,
"want":10
},
"label":[
"Vision Recordings"
],
"catno":"VSNCD001P",
"year":"2010",
"genre":[
"Electronic"
],
"title":"Noisia - Split The Atom",
"resource_url":"http://api.discogs.com/releases/3071347",
"type":"release",
"id":3071347
}
]
}
Just making it look nice
You'll need to work with the values in the results
hash then... how come you want the data in the template file, and aren't using a hook to modify the post text like the other plugins?
Oh! *facepalm* RIGHT. I forgot the GitHub embed plugin uses templates.js because I was do used to doing it the derp way (creating HTML in javascript, heh).
Here is where I pass in the issue data. Notice I am calling appModule.render
, which is defined in Embed.init
.
Got a repo I can check out? Would be easier than going through the list of how a template can be done wrong (no offense @psychobunny )
There shouldn't be any need to funnel all requests into their OAuth flow, especially since you're doing this server-side. Is there any way for you to generate a token in the Discogs API settings, instead of having to step through and authorize yourself?
@julian said:
var imageUrl = whatever; imageUrl.replace('api.discogs', 's.pixogs');
Object #<Object> has no method 'replace'
I didn't actually use whatever, but it was either a not defined error, or this one. I also tried using things like
$('img[src="http://api.discogs.com"]').attr('src','http://s.pixogs.com');
But nothing changed.