Closed Rudancy closed 2 years ago
You've got the the target set up as instafeedGallery - have you got a div with that id on your page?
<div id="instafeedGallery"></div>
<script type="text/javascript">
var gallerScreenFeed = new Instafeed({
accessToken: AccessToken,
target: instafeedGallery,
limit: 5,
resolution: 'thumbnail',
template: '<a href="{{link}}"><img title="{{caption}}" src="{{image}}" /></a>'
});
gallerScreenFeed.run();
</script>
Hi Yeah didnt add that on my last code snippet
does the template render where the target div is?
`{% extends 'base.html' %}{% load static %}
{% block title %} Arkham Knights {% endblock %}
{% block body %}
<h1>i am here</h1>
<div>
</div>
<div id="instafeedGallery"></div>
<script type="text/javascript">
var gallerScreenFeed = new Instafeed({
accessToken: AccessToken,
target: instafeedGallery,
limit: 5,
resolution: 'thumbnail',
template: '<a href="{{link}}"><img title="{{caption}}" src="{{image}}" /></a>'
});
gallerScreenFeed.run();
</script>
{% endblock %}`
thought i would send you the whole page
What service are you using for you access token? If it's instant-tokens.com the value should be "InstagramToken" not "AccessToken" - beyond that I don't believe "resolution" is a valid option in the latest release but shouldn't cause a failure - are you using Version 2 RC3? Are you getting a console error?
so i am using the heroku app instagram-token-agent , i have deleted the resolution option and no affect. I tried
success: function (response) {
console.log("Instafeed.js response", response);
}
and in the console i got Instafeed.js response {data: Array(8), paging: {…}} data: (8) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}] paging: {cursors: {…}} proto: Object
so the imgaes are there they are just not showing,
also when i do not use the template option they do show.... its very strange
thanks for your time
I am getting the same issue here. It's definitely bringing back data from Insta, but when I add a template string, it doesn't render it properly.
Same happened to me. i used larvae in my web page and i ' m receiving this error:
Yeah I worked out what the issue was in the end and felt very silly. It's because I was using twig templates, which already use the double braces. you need to escape the double braces in your template, like so:
'<img src="{{'{{image}}'}}" alt="" width="100%" >'
This issue has been automatically marked as stale because it hasn't had new comments in the last 3 months. It will be closed if no further activity occurs. If you still need assistance with this issue, or believe it shouldn't be closed, please respond with a new comment to let us know. Thank you all for your contributions.
Hi,
Thanks for such a great library, I am very new to coding and I am trying to get the templating up and running but whenever i use a the template it does not render the posts, however if i do not use the template it works
{% extends 'base.html' %}{% load static %}
{% block title %} Arkham Knights {% endblock %}
{% block body %}
i am here
{% endblock %}
I am using django 3, not sure if that has anything to do with it
I feel i am missing something very basic here, like i am need to direct the template html to a div. I have tried looking on the internet for info on templates in js. Sorry if this is a Newbie question